Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

[How To] Install Subsonic 4.8 on FreeNAS 9.1.1

thorndike

Neophyte
Joined
Sep 23, 2013
Messages
11
May I suggest putting the step that required UNCHECKING the VANILLA setting in BOLD? Unfortunately, I had to recreate my subsonic jail and forgot that very important step. Now I have to rebuild and recompile....argh!
 

Stab

Newbie
Joined
Nov 3, 2013
Messages
3
Hi !
First of all thanks for this great tutorial, I followed it and it works like a charm.
However I have a little problem, the autostart function is not working, I can launch subsonic by typing "jexec 1 /usr/local/etc/rc.d/subsonic start" in a shell but it doesn't launch at startup.
I created the file " /usr/local/etc/rc.d/subsonic", i made it executable and added
  1. # subsonic start up
  2. subsonic_enable="YES"
  3. subsonic_user="sonic"
  4. subsonic_bin="/home/sonic/subsonic/standalone/subsonic.sh"
in "/etc/rc.conf"
Any ideas ?
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Hi !
First of all thanks for this great tutorial, I followed it and it works like a charm.
However I have a little problem, the autostart function is not working, I can launch subsonic by typing "jexec 1 /usr/local/etc/rc.d/subsonic start" in a shell but it doesn't launch at startup.
I created the file " /usr/local/etc/rc.d/subsonic", i made it executable and added
  1. # subsonic start up
  2. subsonic_enable="YES"
  3. subsonic_user="sonic"
  4. subsonic_bin="/home/sonic/subsonic/standalone/subsonic.sh"
in "/etc/rc.conf"

Any ideas ?
Did you double check all your path statements in those files?

What are your perrmision and owner of /usr/local/etc/rc.d/subsonic?
Code:
% ls -al /usr/local/etc/rc.d/subsonic

Have you looked at dmesg for errors, do you get any errors when you try as per
To test it out you can locate the subsonic process with Top and kill it, then issue the above command and it should start subsonic and give you the pid of the process.
Lastly, check out the rc debug tool.
 

Stab

Newbie
Joined
Nov 3, 2013
Messages
3
Thanks for your quick answer.
Yes the paths are valids, I used the same folders as in your tutorial.
I can lauch subsonic as "root" or as "sonic" with "/usr/local/etc/rc.d/subsonic start" without any problem, it's just the startup script that doesn't works with me
Here's the result of "ls -al /usr/local/etc/rc.d/subsonic" :
Code:
-rwxr-xr--  1 root  wheel  720 Nov  3 16:11 /usr/local/etc/rc.d/subsonic

Nothing in dmesg, I checked with rc debug, but I do not see anything about subsonic in /var/logs/messages
One more question, should I change this in "/usr/local/etc/rc.d/subsonic"
Code:
: ${subsonic_enable="NO"}
: ${subsonic_user="root"}
: ${subsonic_bin="/usr/local/sbin/subsonic.sh"}


EDIT : It's seems that it's working now using this startup script :
Code:
    #!/bin/sh
    #
    # PROVIDE: subsonic
    # REQUIRE: LOGIN
    # KEYWORD: shutdown
    #
    # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
    # to enable this service:
    #
    # subsonic_enable (bool):  Set to NO by default.
    #            Set it to YES to enable it.
 
    . /etc/rc.subr
 
    name="subsonic"
    rcvar=${name}_enable
    subsonic_enable=${subsonic_enable-"NO"}
    pidfile="/var/run/${name}.pid"
    procname="/usr/local/openjdk7/bin/java"
 
    start_cmd="subsonic_start"
 
    start_precmd="rm -f $pidfile"
    stop_postcmd=$start_precmd
 
    subsonic_start()
    {
      echo "Starting Subsonic"
      export PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
      cd /home/sonic/subsonic/standalone
      sh subsonic.sh
    }
 
 
    load_rc_config $name
    run_rc_command "$1"

I found it here : http://forum.madsonic.org/viewtopic.php?t=475&p=817
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
@Stab
Just out of curiosity can you ssh into your subsonic user jail as a regular user and post the output of:
Code:
echo $PATH
 

Stab

Newbie
Joined
Nov 3, 2013
Messages
3
Here you go :
Code:
$    echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
$
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Here you go :
Code:
$    echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
$
yea, thats the path if you run the command as root. I wanted a different command run but I got to see what I wanted anyway. Thanks.
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Updated 11/21 with a new more readable/follow-able format. Any feedback is always welcome, however it may take some time to sink in.;)
 

the_tox

Member
Joined
Oct 1, 2013
Messages
150
Updated 11/21 with a new more readable/follow-able format. Any feedback is always welcome, however it may take some time to sink in.
So now that there's a new beta out... I've been nervous about trying to upgrade to 4.9beta1 at the risk of messing something up. Do you know if just subsonic.jar needs to be replaced in the subsonic directory or is there more of a process?
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
So now that there's a new beta out... I've been nervous about trying to upgrade to 4.9beta1 at the risk of messing something up. Do you know if just subsonic.jar needs to be replaced in the subsonic directory or is there more of a process?
I have been reading a few things about it and do not think it will be a big problem. However, I am going to wait for the real deal 4.9 before I start messing around, things are working pretty good.:)

If you try it let me know what happens please.

I am thinking about doing the whole war file when the new version comes out depending on their upgrade path.
 

the_tox

Member
Joined
Oct 1, 2013
Messages
150
I have been reading a few things about it and do not think it will be a big problem. However, I am going to wait for the real deal 4.9 before I start messing around, things are working pretty good.:)

If you try it let me know what happens please.

I am thinking about doing the whole war file when the new version comes out depending on their upgrade path.
I was thinking the same thing (leave it alone until 4.9 drops). Since beta2 just came out, it might be getting close. I'm reluctant to go back in and set up my subsonic config file again if I don't have to... I'm hoping I can upgrade by replacing everything except the config file.
 

Ngjtt

Neophyte
Joined
Sep 24, 2012
Messages
8
I forgot to check the lame checkbox after the make command. (stupid of my I tried to select with enter) can anyone tell me how to do this afterwards?
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
I forgot to check the lame checkbox after the make command. (stupid of my I tried to select with enter) can anyone tell me how to do this afterwards?
Try "make config" and see if it presents you with the options again. To be clear, you will have to compile it over again starting with the command "make config".
 

Ngjtt

Neophyte
Joined
Sep 24, 2012
Messages
8
Try "make config" and see if it presents you with the options again. To be clear, you will have to compile it over again starting with the command "make config".
That worked thanks. make config gave me the options back, afterwards had to give the make command to execute the changes made
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Please click the like button if you find this useful, it keeps me motivated and lets me know how useful this post was to users. Thanks
Update: 12/12/2013
They renamed some ports and also added ffmpeg 2 :cool: to the ports tree. I have made a small change to the instructions and am compiling it now to see how it works. --- Tested and is working good streaming to my linux box. You can check what version you are using with
Code:
# ffmpeg --version

To upgrade to ffmpeg 2.x
log into your sonic jail as root user and run
Code:
# portsnap fetch update
this will take a little while. When that is done
Code:
# cd /usr/ports/multimedia/ffmpeg
Code:
# make
Make sure the LAME section is checked and AAC if you want it.
Code:
# make install clean
When that is done we want to remove the old link in subsonic folder and create another one for the new ffmpeg version
Code:
# rm /home/sonic/subsonic/transcode/ffmpeg
Code:
# ln /usr/local/bin/ffmpeg /home/sonic/subsonic/transcode/ffmpeg
Verify your new link is owned by your regular user and not root
Code:
ls -l /home/sonic/subsonic/transcode/ffmpeg

That is it, we can now take advantage of all the new version 2 features and bug fixes.

Update 2:
It appears that the configure step already has Lame support turned on.:) This is great news because we should just be able to use pkg to install ffmpeg instead of compiling from scratch.
It does not appear to be packaged yet so that will have to wait.
 

the_tox

Member
Joined
Oct 1, 2013
Messages
150
Please click the like button if you find this useful, it keeps me motivated and lets me know how useful this post was to users. Thanks
Update: 12/12/2013
They renamed some ports and also added ffmpeg 2 :cool: to the ports tree. I have made a small change to the instructions and am compiling it now to see how it works. --- Tested and is working good streaming to my linux box.
[omitted for length]
Update 2:
It appears that the configure step already has Lame support turned on.:) This is great news because we should just be able to use pkg to install ffmpeg instead of compiling from scratch.
It does not appear to be packaged yet so that will have to wait.
I'll hold off on this until I've successfully upgraded to 4.9. After seeing the changelog for beta 3, I'm pretty excited. If you decide to upgrade when the final release is out, I'll be very happy if you make a post on the upgrade process :)
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
I'll hold off on this until I've successfully upgraded to 4.9. After seeing the changelog for beta 3, I'm pretty excited. If you decide to upgrade when the final release is out, I'll be very happy if you make a post on the upgrade process :)
Looks like Freenas 9.2 and Subsonic 4.9 might be coming together all at the same time, should be interesting. :D I do plan on updating the thread or possibly starting a new one for FN9.2 if things get complicated.
 

di0de

Member
Joined
Oct 19, 2013
Messages
48
Sorry if the question has been answered, I skimmed this thread but didn't see it addressed. Is it completely necessary to create a new dataset for music/media? I already have tons of music in several different folders on my NAS, can I just use what I already have?

Thanks.
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Sorry if the question has been answered, I skimmed this thread but didn't see it addressed. Is it completely necessary to create a new dataset for music/media? I already have tons of music in several different folders on my NAS, can I just use what I already have?

Thanks.
You can use any dataset you want, the guide just demonstrates how to do it for people that do not already have one.
 

anika200

Member
Joined
Mar 18, 2013
Messages
112
Update 12/25/2013:
I just want to let everyone know that I upgraded to FreeNAS 9.2 via the GUI upgrade process and all is well with Subsonic etc....
 
Top