Setting up the multimedia (BT, DLNA/uPnP, iTunes) bits in 8.0.3-RELEASE_MULTIMEDIA

Status
Not open for further replies.
G

gcooper

Guest
SKIP TO POST # 15 (DLNA), # 45 (BT) or # 64 (iTunes)! These directions are busted :/..

The following guide is intermediate and is aimed towards individuals who want to look at the multimedia components in FreeNAS that will be present in 8.2.0 as plugins, but with a stable codebase until the official 8.2.0 release is done.

This writeup assumes the following:

1. You want to test out the BT, DLNA/uPnP, iTunes applications before the official plugins are released for 8.2.0.
2. You aren't afraid to go on to the command line/shell (use ee/vi, etc) to get things to work.
3. You can do basic troubleshooting to get things, or provide enough information in order to get things to work.

The examples in this email assume the following:

1. The username is "gcooper".
2. The path to the location where the media files is stored is housed somewhere on '/mnt/tank'.

The flow of the writeup is as follows:

* FAQs
* Bittorrent (Transmission)
- Copying over the Files
- Modifying the Sample File
- Enabling Transmission at Boot
- Controlling Transmission Remotely
* DLNA/uPnP (minidlna)
* iTunes (firefly)
* References

==========
FAQs
==========

* Q: Why isn't this stuff in the GUI yet?
* A: We're working on it and it'll be in 8.2.0+. Please be patient.

* Q: Why did you rewrite FreeNAS 8.x? FreeNAS 0.7 did this and more!
* A: Perhaps it was more featureful in this area, but it wasn't extensible. This is off-topic and not relevant.

* Q: Why are you using software A.B.C (ex. minidlna) instead of X.Y.Z (e.g. mediatomb, serviio)?
* A: This has been hashed over in several threads prior to this; as such I suggest that you search in the forums before asking this question. If you want to discuss importing a different piece of software and standardizing "the" defacto plugin on that software, please PM me with your request and a working procedure and/or end-to-end documentation on how to integrate it into FreeNAS using command line arguments and/or a set of configuration files. I'd like to avoid Serviio if at all possible though because it's Java based and Java requires X11 stuff in order to function (my goal is to remove all of the X11 components from FreeNAS eventually).

* Q: But mediatomb/transmission/etc already has a GUI? Why aren't you using that?
* A: That works for general purpose machines/users, but we want the software to cleanly tie into FreeNAS.

* Q: Why aren't you using Fuppes? It's in FreeNAS 0.7?
* A: The website's been dead for quite a while and it appears to be an inactive project. FreeNAS and some of the developers involved aren't interested in taking on any more projects at this time :).

==========
Bittorrent
==========

---------------------------------
Preconditions
---------------------------------

1. You need to create a user with a home directory on persistent storage (e.g. '/mnt/tank/home/gcooper').

---------------------------------
Copying Over the Files
---------------------------------

1. Login as the user that will be running transmission, e.g. "gcooper".
2. Issue the following commands to copy the file over the sample settings.json file, modifying according to your user's settings, and create some directories for Transmission:

Code:
mkdir -p "$HOME/.config/transmission-daemon"
mkdir -p "$HOME/transmission/incomplete"
mkdir -p "$HOME/transmission/complete"
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \
       -e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json


---------------------------------
The Sample File
---------------------------------

A sample settings.json file is present in $HOME/.config/transmission-daemon/settings.json ; some settings
that you might want to change are as follows:

peer-port : the port used for incoming BitTorrent requests. You probably want to change this and make sure to open up the firewall / NAT on your router/switch if needed to to your NAS box.
speed-limit-down : download speed limit
speed-limit-down-enabled : download speed limit toggle
speed-limit-up : upload speed limit
speed-limit-up-enabled : upload speed limit toggle

---------------------------------
Enabling Transmission at Boot
---------------------------------

Run the following commands as root:

Code:
mount -wu /
sed -i '' \
    -e 's/\(transmission_enable="\)NO"/\1YES"/' \
    -e 's/\(transmission_user="\)myuser/\1'`whoami`'\"/g' /etc/rc.conf
sed -i '' \
    -e 's/\(transmission_enable="\)NO"/\1YES"/' \
    -e 's/\(transmission_user="\)myuser/\1'`whoami`'\"/g' /conf/base/etc/rc.conf
mount -ru /


---------------------------------
Controlling Transmission Remotely
---------------------------------

Remote control is a really cool feature in transmission. You can login from authorized boxes while the daemon runs in the background grinding away on torrents

You can control (add torrents, monitor download stats, change settings, etc) the transmission daemon on your FreeNAS box by connecting via one of the clients noted here (look for Transmission-remote-*): http://www.transmissionbt.com/resources/ . The author recommends "transmission-remote-dotnet" for Windows users.

The key to enabling the remote control feature is to change
Code:
rpc-enabled
to
Code:
true
in settings.json. The author suggests setting a value for
Code:
rpc-username
and changing
Code:
rpc-password
to something more meaningful.

---------------------------------
Testing Your Changes
---------------------------------

The best way to test your changes is to execute the following as root:

Code:
transmission-daemon -f


This will run transmission in the foreground so you can monitor progress when adding files to daemon.

Once you're satisfied with your results, enter in "Control-C" to exit from the daemon (this will potentially interrupt any torrent service being done at the time), and then enter in the following command as root:
Code:
service transmission start
and
Code:
service transmission status
to verify that the daemon is running. Congratulations -- you now have a working torrent client on FreeNAS!

==========
DLNA/uPnP
==========

---------------------------------
Preconditions
---------------------------------

1. You need to create a user with a home directory on persistent storage (e.g. '/mnt/tank/home/gcooper').

---------------------------------
Copying Over the Files
---------------------------------

1. Login as the user that will be housing the config files, e.g. "gcooper".
2. Issue the following commands to copy the file over the sample minidlna.conf file, modifying according to your user's settings, and create some directories for Minidlna:

Code:
mkdir -p "$HOME/var/db/minidlna"
mount -wu /
cp /conf/base/usr/local/etc/minidlna.conf $HOME/.
sed -i '' -e "s,/mnt/tank/home,`dirname $HOME`,g" \
            -e "s/myuser/`whoami`/g" \
            $HOME/minidlna.conf


---------------------------------
The Sample File
---------------------------------

A sample minidlna.conf file is present in $HOME/minidlna.conf ; some settings that you might want to change are as follows:

db_dir : directory where the minidlna media database will live.
media_dir : directory where media files can be grabbed from.

---------------------------------
Enabling minidlna at Boot
---------------------------------

Run the following commands as root:

Code:
mount -wu /
sed -i '' \
    -e 's/\(minidlna_enable="\)NO"/\1YES"/' \
    -e "s,\(minidlna_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /etc/rc.conf
sed -i '' \
    -e 's/\(minidlna_enable="\)NO"/\1YES"/' \
    -e "s,\(minidlna_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /conf/base/etc/rc.conf
mount -ru /


---------------------------------
Testing Your Changes
---------------------------------

The best way to test your changes is to execute the following as root:

Code:
mt-daapd -d -f $HOME/minidlna.conf


This will run firefly in the foreground so you can monitor progress when adding files to daemon.

Once you're satisfied with your results, enter in "Control-C" to exit from the daemon, and then enter in the following command as root:
Code:
service minidlna start
and
Code:
service minidlna status
to verify that the daemon is running. Congratulations -- you now have a working DLNA server running on FreeNAS!

==========
iTunes
==========

---------------------------------
Preconditions
---------------------------------

1. You need to create a user with a home directory on persistent storage (e.g. '/mnt/tank/home/gcooper').

---------------------------------
Copying Over the Files
---------------------------------

1. Login as the user that will be housing the config files, e.g. "gcooper".
2. Issue the following commands to copy the file over the sample mt-daapd.conf file, modifying according to your user's settings, and create some directories for Firefly:

Code:
mkdir -p "$HOME/var/db/mt-daapd"
chown daapd "$HOME/var/db/mt-daapd"
mount -wu /
cp /conf/base/usr/local/etc/mt-daapd.conf $HOME/.
sed -i '' -e "s,/mnt/tank/home,`dirname $HOME`,g" \
            -e "s/myuser/`whoami`/g" \
            $HOME/mt-daapd.conf


---------------------------------
The Sample File
---------------------------------

A sample mt-daapd.conf file is present in $HOME/mt-daapd.conf ; some settings that you might want to change are as follows:

admin_pw : administrator password.
db_parms : path for the where the iTunes/Firefly database should be.
mp3_dir : directory for where the mp3s, etc can be found.
servername : name of the iTunes share.

---------------------------------
Enabling mt-daapd at Boot
---------------------------------

Run the following commands as root:

Code:
mount -wu /
sed -i '' \
    -e 's/\(mt_daapd_enable="\)NO"/\1YES"/' \
    -e "s,\(mtdaapd_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /etc/rc.conf
sed -i '' \
    -e 's/\(mt_daapd_enable="\)NO"/\1YES"/' \
    -e "s,\(mtdaapd_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /conf/base/etc/rc.conf
mount -ru /


---------------------------------
Testing Your Changes
---------------------------------

The best way to test your changes is to execute the following as root:

Code:
mt-daapd -c $HOME/mt-daapd.conf -f


This will run firefly in the foreground so you can monitor progress when adding files to daemon.

Once you're satisfied with your results, enter in "Control-C" to exit from the daemon, and then enter in the following command as root:
Code:
service mt-daapd start
and
Code:
service mt-daapd status
to verify that the daemon is running. Congratulations -- you now have a working iTunes server running on FreeNAS!

==========
References
==========

---------------------------------
BitTorrent (Transmission)
---------------------------------

1. Editing config files in Transmission - https://trac.transmissionbt.com/wiki/EditConfigFiles

---------------------------------
DLNA/uPNP (Minidlna)
---------------------------------

1. http://forums.freenas.org/showthrea...dlna-on-the-freenas-nightlies-post-09-25-2011

---------------------------------
Daapd/iTunes (firefly)
---------------------------------

1. http://forums.freenas.org/showthrea...efly-on-the-freenas-nightlies-post-09-25-2011
 

dziring

Dabbler
Joined
Aug 17, 2011
Messages
37
A couple of observations:
1. Your mkdir command creates ~/transmission/completed but the settings file expects the directory to be called 'complete'
2. The sed command didn't work for me, but I didn't try to debug. I just replaced the /mnt/tank/home/myuser with the correct user home path, and "myuser" with the right username.
 

dziring

Dabbler
Joined
Aug 17, 2011
Messages
37
Next observation (and a small cry for help):

I had success with running the transmission-daemon in the foreground, but as soon as I tried to start it as a service, I got the following:

Starting transmission.
TERM: Undefined variable.
/usr/local/etc/rc.d/transmission: WARNING: failed to start transmission

The only major difference between my setup and the sample above, that I can think of, is that my user home directory is /mnt/pool/zeke instead of /mnt/tank/home/zeke, and I believe i corrected for that in the settings file.


--
EDIT: My own fault. Stupid typo.
 

sonisame72

Dabbler
Joined
Aug 14, 2011
Messages
25
I see the user home directory and transmission/minidlna settings.json and db directory are sitting on a disk(mnt). If one enables minidlna and transmission on boot, what does this do to disk spindown? Will these processes keep spinning disk all day?


PS gcooper, I cant get mkv's to work on ps3 or my sharp tv (as seen by other users also) using minidlna either. I get unsupported file format error. Other than that ps3 seems to be working file with all other hd files( .ts/.tp).
 

MrWGT

Cadet
Joined
Jan 6, 2012
Messages
7
Is the file mt-daapd.conf not located at /conf/base/etc/local/mt-daapd.conf instead of /conf/base/usr/local/etc/mt-daapd.conf? So the command should look like
Code:
mkdir -p "$HOME/var/db/mt-daapd"
chown daapd "$HOME/var/db/mt-daapd"
mount -wu /
cp /conf/base/etc/local/mt-daapd.conf $HOME/.
sed -i '' -e "s,/mnt/tank/home,`dirname $HOME`,g" \
            -e "s/myuser/`whoami`/g" \
            $HOME/mt-daapd.conf
?

Gerd
 

fka

Dabbler
Joined
Jan 9, 2012
Messages
15
using MrWGTs suggestion I can get firefly to run, scan my mp3s and generate a db. But only when logged in as root and only after editing /usr/local/etc/mt-daapd.conf (edit lost post reboot.)

Code:
[root@NAS] ~# service mt-daapd start
Starting firefly.
Error reading config file (/usr/local/etc/mt-daapd.conf)
/usr/local/etc/rc.d/mt-daapd: WARNING: failed to start firefly



If i try to start logged in as my mt-daapd user i get:
Code:
[FKA@NAS] ~> service mt-daapd start -y
/etc/rc.conf.local: cannot create /var/tmp/rc.conf.freenas: Permission denied


Without -y i get:
Code:
[FKA@NAS] ~> service mt-daapd start
Starting firefly.
You are not root.  This is almost certainly wrong.  If you are
sure you want to do this, use the -y command-line switch
/usr/local/etc/rc.d/mt-daapd: WARNING: failed to start firefly


just to avoid permissions problems FKA is the owner of the volume ..

Logged in as root I get:

Code:
[root@NAS] ~# service mt-daapd start
Starting firefly.
[root@NAS] ~# service mt-daapd status
firefly is running as pid 2596.


However even though I can get firefly to run logged in as root and iTunes sees the share, iTunes just hangs (with no network activity) at "Loading FreeNAS svn ... "

Code:
Jan  9 20:03:33 NAS mt-daapd[2428]: Config entry general/compress is deprecated.  Please review the sample config
Jan  9 20:03:33 NAS mt-daapd[2428]: Firefly Version svn-1696: Starting with debuglevel 5
Jan  9 20:03:33 NAS mt-daapd[2428]: Plugin loaded: rsp/svn-1696
Jan  9 20:03:33 NAS mt-daapd[2428]: Plugin loaded: ssc-script/svn-1696
Jan  9 20:03:33 NAS mt-daapd[2428]: Plugin loaded: daap/svn-1696
Jan  9 20:03:33 NAS mt-daapd[2428]: Starting rendezvous daemon
Jan  9 20:03:33 NAS mt-daapd[2428]: Starting signal handler
Jan  9 20:03:33 NAS mt-daapd[2430]: Initializing database
Jan  9 20:03:34 NAS mt-daapd[2430]: Starting web server from /usr/local/share/mt-daapd/admin-root on port 3689
Jan  9 20:03:34 NAS mt-daapd[2430]: Registering rendezvous names
Jan  9 20:03:34 NAS mt-daapd[2430]: Serving 6422 songs.  Startup complete in 1 seconds
Jan  9 20:03:34 NAS mt-daapd[2430]: Rescanning database
Jan  9 20:03:56 NAS mt-daapd[2430]: Error reading: Unknown error
Jan  9 20:03:56 NAS last message repeated 9 times
Jan  9 20:03:58 NAS mt-daapd[2430]: Starting playlist scan
Jan  9 20:03:58 NAS mt-daapd[2430]: Updating playlists
Jan  9 20:03:59 NAS mt-daapd[2430]: Scanned 6422 songs (was 6422) in 25 seconds


I'm assuming the problem i have is because mt-daapd is being started from root as apposed to the mt-daapd user?
Any help/advice would be much appreciated.

Cheers
FKA
 

MrWGT

Cadet
Joined
Jan 6, 2012
Messages
7
1) The last problem (iTunes hangs) is due to changes in iTunes which are not compatible with the supplied firefly version. I've seen post (search google for "itunes firefly freebsd") stating that there is a solution - not checked so far.

2) I started my setup according to thread http://forums.freenas.org/showthrea...efly-on-the-freenas-nightlies-post-09-25-2011. After that all worked but after a reboot the changes to /usr/local/etc/mt-daapd.conf are lost. I figured out that the content of /conf/base/etc/local/mt-daapd.conf is copied to /usr/local/etc/mt-daapd.conf at startup so changes made in the /conf/base... file are "reboot save".

3) After a reboot the user "daapd" was lost so i just added the user daapd using gui and now firefly is running ok after a reboot.

Gerd

freenas-803-firefly-setup.jpg
 

fka

Dabbler
Joined
Jan 9, 2012
Messages
15
thanks for the reply

I'd forgotten about /conf/base/etc/local from when i messed around with openvpn !

Id read this thread https://discussions.apple.com/thread/3372281?start=150&tstart=0 but only to the point where 10.5.1 is reported to fix the problem .... reading on 10.5.2 breaks it again !!

Oh well maybe apple will get it together in time for FreeNAS 8.2 !

Cheers
D
 
G

gcooper

Guest
A couple of observations:
1. Your mkdir command creates ~/transmission/completed but the settings file expects the directory to be called 'complete'
2. The sed command didn't work for me, but I didn't try to debug. I just replaced the /mnt/tank/home/myuser with the correct user home path, and "myuser" with the right username.

1. Thanks. I'll update the directions in a bit.
2. I'll fix that nasty sed.
 
G

gcooper

Guest
using MrWGTs suggestion I can get firefly to run, scan my mp3s and generate a db. But only when logged in as root and only after editing /usr/local/etc/mt-daapd.conf (edit lost post reboot.)

You discovered a gap in the directions for all 3 'recipes'. You need to be the user when creating the files, but be root when starting the services. Will fix this item in the directions!
 

dziring

Dabbler
Joined
Aug 17, 2011
Messages
37
I missed saying this in my earlier post, but Thanks for preparing this post. It's much appreciated.
 

Skaven

Dabbler
Joined
Oct 25, 2011
Messages
31
hello i´m normoly using Linux systems so I'm new on BSD, i haw a problem whit a step my question is this 1 command? or is it 3 commands?
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \
-e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json

is this 1 or is it 3 commands?

like
step 1
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
Enter

step 2
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \
Enter

step 3
-e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
Enter

os is only 1 step?
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \
-e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
Enter

?

and my user account home folder is /mnt/Internet_Disk/user/home/golab so should i edit the command sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \ to be sed -e '' -i '' "s,/mnt/Internet_Disk/user/home/golab,`dirname $HOME`,g" \


and when is do cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/. should i do it whit root to my account golab ? when i do it when i log din whit go lab i get permission denied
 

dziring

Dabbler
Joined
Aug 17, 2011
Messages
37
...

is this 1 or is it 3 commands?

like
step 1
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
Enter

step 2
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \
Enter

step 3
-e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
Enter

os is only 1 step?
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \
-e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
Enter

?
...

Half way in between. It's two commands. One is the cp command, copying settings.json to the right location.
The other is a sed command intended to replace "/mnt/tank/home" with the correct home directory for your system, and "myuser" with the user under which transmission is being installed.

I found it easier to do this by hand, but that's just me.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
MiniDLNA Procedure by Joe

Minimum Requirements: 8.0.3-MULTIMEDIA installed, establish your media directories and populate them with something to use.
**Look at the bottom of this posting for upgrade instructions**

This procedure does not require a specific user account however you must log in as root. You may use the Console or I prefer SSH.

Assumptions:
"pool" reference = your hard drive pool name. This must change based on your pool name.
"dlna" reference is the directory your configuration and minidlna database resides in and can remain this name.


1. Log in as root (SSH or Console)
2. Enter the following commands:
Code:
mount -wu /
mkdir -p /mnt/pool/dlna/var/db/minidlna
cd /mnt/pool/dlna
cp /conf/base/etc/local/minidlna.conf .
ee minidlna.conf


3. At this point you need to edit the "media_dir=" lines to point to your media directories and remove the hash # mark from the beginning of each line you change to enable it.

You can choose listing a single directory for everything if you like:
media_dir=/mnt/pool/media

or individually:
media_dir=V,/mnt/pool/movies
media_dir=A,/mnt/pool/music
media_dir=P,/mnt/pool/photos

You need to update the db_dir path:
db_dir=/mnt/pool/dlna/var/db/minidlna

NOTE: Use as many lines as you need to add, you are not limited to a single media destination. Example:
media_dir=A,/mnt/pool/Jennifer/music
media_dir=A,/mnt/pool/Daisy/music

You can also select the name of your DLNA Server:
friendly_name=Media Server

When done hit the Escape key and select save.

This concludes the main setup and it will be retained even after you perform an update to your FreeNAS version.

------

Now to activate the service.

4. We must update the one file that is restored on every reboot in order to ensure the system runs.
Code:
cd /conf/base/etc
ee rc.conf

Scroll down to where you read minidlna_enable="NO" and change it to "YES"

5. Change the next line from minidlna_flags="-f /mnt/tank/home/myuser/minidlna.conf" to
Code:
minidlna_flags="-f /mnt/pool/dlna/minidlna.conf"

NOTE: change 'pool' to your pool mount point as in the above setup.

Press Escape and save the file.

6. At this point you could type 'mount -ro /' and then 'reboot' and the system should run, BUT we could test this first to ensure you have the paths correct to your files...

7. Lets update the current rc.conf as well so we can test if this works before rebooting.
Code:
cd /etc
ee rc.conf

Scroll down to where you read minidlna_enable="NO" and change it to "YES"

8. Change the next line from minidlna_flags="-f /mnt/tank/home/myuser/minidlna.conf" to
Code:
minidlna_flags="-f /mnt/pool/dlna/minidlna.conf"

Press Escape and save the file.

9. Now to close the boot system drive (MUST DO THIS)
Code:
mount -ro /


10. To test run the system type
Code:
service minidlna start

If you have a lot of media files you should see your hard drive in heavy use as it builds up the database of available media.

Other commands are:
service minidlna restart
service minidlna stop

Once your hard drive has slowed down, test out your DLNA service and watch a movie, play a song, look at a photo.
Last thing, reboot the NAS and make sure minidlna runs. If it doesn't then you need to revisit the /conf/base/etc/rc.conf file and make sure it's correct. Remember you need to mount -uw / before you can change it and mount -ro / after the changes.

Some Additional Information...

1) All your configuration information is stored on your pool. This means that if/when you update your FreeNAS installation, you only need to perform the activation part above (editing /conf/base/etc/rc.conf).

2) MiniDLNA currently does not automatically update the database when you add a file. This is a FreeBSD limitation. To recognize new files you can reboot the system, restart minidlna manually, or set up a CRON job to restart the service periodically. This goes beyond this How-To. With any luck there will be a fix but I'm not holding my breath.

3) MiniDLNA does not transcode. This means that if the media is not in a format that the player can play, it will fail. A PS3 will play many formats but not all. Many new Blu-Ray players will play many formats. Some players don't support DNLA at all.

If you have a problem with this procedure, please provide specific feedback and if the procedure is incorrect, I'll change it. If you need assistance, I'll do my best to provide it.

-Joe

EDIT: If you are upgrading from 8.0.3 or 8.0.4 to a newer version of 8.0.4 and you have already had MiniDLNA configured IAW these instructions, you only need to do the following steps.
Code:
mount -uw /

Now do steps 4, 5, and 9, then wait 5 seconds (let the flash drive finish writing) and type reboot.
 

Skaven

Dabbler
Joined
Oct 25, 2011
Messages
31
Half way in between. It's two commands. One is the cp command, copying settings.json to the right location.
The other is a sed command intended to replace "/mnt/tank/home" with the correct home directory for your system, and "myuser" with the user under which transmission is being installed.

I found it easier to do this by hand, but that's just me.



so u mean the command should be? sed -e '' -i '' "s,/mnt/Internet_Disk/user/home,`dirname $HOME`,g" \ -e 's,golab,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json

because i get the error


[golab@freenas] ~> sed -e '' -i '' "s,/mnt/Internet_Disk/user/home,`dirname $HOME`,g" \ -e 's,golab,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
sed: s,/mnt/Internet_Disk/user/home,/mnt/Internet_Disk/user/home,g: No such file or directory
[golab@freenas] ~>
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
so u mean the command should be? sed -e '' -i '' "s,/mnt/Internet_Disk/user/home,`dirname $HOME`,g" \ -e 's,golab,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json

because i get the error


[golab@freenas] ~> sed -e '' -i '' "s,/mnt/Internet_Disk/user/home,`dirname $HOME`,g" \ -e 's,golab,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
sed: s,/mnt/Internet_Disk/user/home,/mnt/Internet_Disk/user/home,g: No such file or directory
[golab@freenas] ~>

Try this:
Code:
step 1
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
Enter

step 2
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g"
Enter

step 3
-e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
Enter


Note that on step 2 I removed the "\" which means to process the next line (if I understand it correctly).
The data at the beginning needs to be the same as the original "s,/mnt/......" or "s,myuser" as it's a search function for the code you are changing, the second part of that string is what it changes to.

Hope this helps.

P.S. I don't believe you can run the lines together as a single line, you are missing the carriage returns.
 

Skaven

Dabbler
Joined
Oct 25, 2011
Messages
31
this is what i haw now dun i haw started from beginning


[golab@freenas] ~> mkdir -p "$HOME/.config/transmission-daemon"
[golab@freenas] ~> mkdir -p "$HOME/transmission/incomplete"
[golab@freenas] ~> mkdir -p "$HOME/transmission/complete"
[golab@freenas] ~> cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
cp: /usr/local/etc/transmission/home/settings.json: Permission denied
[golab@freenas] ~> su
Password:
[golab@freenas] /mnt/Internet_Disk/user/home/golab# cp /usr/local/etc/transmission/home/settings.json /mnt/Internet_Disk/user/home/golab/.config/transmission-daemon/.
[golab@freenas] /mnt/Internet_Disk/user/home/golab# exit
exit
[golab@freenas] ~> sed -e '' -i '' "s,/mnt/Internet_Disk/user/home,`dirname $HOME`,g"
sed: s,/mnt/Internet_Disk/user/home,/mnt/Internet_Disk/user/home,g: No such file or directory
[golab@freenas] ~> sed -e '' -i '' "s,/mnt/Internet_Disk/user/home,`dirname $HOME`,g"


but what i´m doing wrong? way is s, and ,g in the home string? what do the do?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
This is the first time I've tried to setup transmission but here is what I'd do to get past your problems.

You did the right thing going to SU to copy the file. now you need to edit the file. The sed lines were designed to make it easy provided they work. Manually edit as follows (I hope I got this right)

cd /mnt/Internet_Disk/user/home/golab/.config/transmission-daemon
ee settings.json

Now you must change the path to your files in two locations. (download directory and incomplete directory) Press Escape and save your work.

Hopefully that will get you over this bump in the road. You will still need to finish the main procedure to enable the service.

EDIT: If you get an error during boot noting RC.CONF, make sure you change /conf/base/etc/rc.conf
 

revoman

Dabbler
Joined
Jan 11, 2012
Messages
13
Since we're talking multimedia

So I just updated my FreeNAS 8 box to a multicore system and have a bunch of CPU cycles free. I would like the ability to run the Handbrake CLI from a FreeNAS plugin. I am a Web/Java developer and could help with the front end if there was support for getting the binaries to build. I would probably start with the ability to manually start the process from the plugin but later add the ability to configure a folder (or multiple for different profiles) toscan for new files and then execute a predetermined profile against the files, one at a time.

Is this something anyone else would be interested in. And would it make sense to put in this type of a release?

-Nate
P.S. I read a thread about Java being a poor choice for FreeNAS because it required X11. That is not true, I've run many java applications on headless systems. The Open-JDK provides a "headless" install package for linux. And the SUN jvm can be run in headless mode with the "-Djava.awt.headless=true" command line argument. Now if the java app in question is written to use windowing toolkits than that changes it. Anyhow, my 2 cents.
 
Status
Not open for further replies.
Top