This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

[How To] Subsonic 6.0 in a Jail

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
StanEsmith
Starter
Starter
Posts: 26
Joined: 13 Mar 2015 16:13
Status: Offline

[How To] Subsonic 6.0 in a Jail

Post by StanEsmith »

Thought I'd give back here and do a write up on installing Subsonic into a jail. I've tried other tutorials yet they always seem to fail when changing things around for new releases. This method takes the given tar from the Subsonic.org site and uses that for installing and updating.

Pretty simple:
1. Create a new jail inside The Brig. Make sure to tick "start jail with system" and make sure you are using the given base files for your given system.
2. Once the jail is created and started go to: (This will enable jails to access the shared ports tree)
Extensions -->TheBrig -->Updates-->Central Ports-->Check mark the new Jail--> Save
**If this is a fresh install click "Fetch and Update"
3. Back to the Jails main page and make sure it is running. Take note the IP address
4. SSH into your nas and run
  • jexec 1 csh
**the number here is the ID for your jail. To check this issue: jls
5. Once you are in your jail you can issue the following commands which will install the required packages.
  • pkg install xtrans xproto xextproto javavmwrapper flac openjdk
  • cd /usr/ports/lang/gcc46/
  • make config
  • make config-recursive
  • make install clean
**Note: If gcc46 fails you can install it with:
pkg install gcc46

6. Continue installing the packages:
  • pkg install libtheora
  • cd /usr/ports/multimedia/ffmpeg
**When making the config for ffmpeg make sure you select Lame, x265 and any other codecs you might need. This allos subsonic to use the ffmpeg transocder when needed.
  • make config
  • make config-recursive
  • make install clean
  • mkdir /var/subsonic
  • mkdir /var/subsonic/transcode
  • mkdir /var/subsonic/standalone
  • cp /usr/local/bin/lame /var/subsonic/transcode/
  • cp /usr/local/bin/flac /var/subsonic/transcode/
  • cp /usr/local/bin/ffmpeg /var/subsonic/transcode/
7. Next we are going to install Subsonic.
  • Go to Subsonic.org and download the tar.gz file for "other systems"
  • Place this file in: /tmp inside your jail filesystem
  • cd /var/subsonic/standalone
  • tar xvzf /tmp/subsonic-6.0-standalone.tar.gz <-------(You will have to adjust the file name as needed)
  • chmod 777 *.*
8. Assuming the above installed successfully, enter the following to start Subsonic manually:
  • sh /var/subsonic/standalone/subsonic.sh
9. Finally:
  • From NAS4Free go to System > Advanced > Command Scripts
  • Click on the ‘+‘ sign to add an additional command script as follows:
  • Command: jexec 1 /var/subsonic/standalone/subsonic.sh
  • Type: PostInit
  • Save and reboot your server.
The plus side of this method is that when new releases happen for Subsonic, you are able to re-run step 7 and relaunch the service and it will be upgraded in place.

User avatar
mrjacobrussell
Starter
Starter
Posts: 62
Joined: 05 Jun 2015 17:57
Status: Offline

Re: [How To] Subsonic 6.0 in a Jail

Post by mrjacobrussell »

Try this out,
on 10.3.0.3773 you can use pkg install,

enable root SSH,
SSH into server
if using a jail:
jexec (jail number) csh


Copy and paste part 1 into putty

cd /tmp
fetch http://subsonic.org/download/subsonic-6 ... one.tar.gz
pkg install xtrans xextproto javavmwrapper flac openjdk gcc46 libtheora ffmpeg

After several minutes and several Yes's

Copy and paste part 2 into putty

mkdir /var/subsonic
mkdir /var/subsonic/transcode
mkdir /var/subsonic/standalone
cp /usr/local/bin/lame /var/subsonic/transcode/
cp /usr/local/bin/flac /var/subsonic/transcode/
cp /usr/local/bin/ffmpeg /var/subsonic/transcode/
cd /var/subsonic/standalone
tar xvzf /tmp/subsonic-6.0-standalone.tar.gz
chmod 777 *.*

sh /var/subsonic/standalone/subsonic.sh
11.2.0.4 - Omnius (revision 6766)
x64-embedded on Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz 16gb ram 15.4Tb pool storage

User avatar
mrjacobrussell
Starter
Starter
Posts: 62
Joined: 05 Jun 2015 17:57
Status: Offline

Re: [How To] Subsonic 6.0 in a Jail

Post by mrjacobrussell »

I had to make a how to video for my speech class so this was what I picked .. if i get it to encode correctly Ill link it.
11.2.0.4 - Omnius (revision 6766)
x64-embedded on Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz 16gb ram 15.4Tb pool storage

User avatar
mrjacobrussell
Starter
Starter
Posts: 62
Joined: 05 Jun 2015 17:57
Status: Offline

Re: [How To] Subsonic 6.0 in a Jail

Post by mrjacobrussell »

updated instructions use gcc6
deleted lame ( ot sure why I keep forgetting to drop it being its not availible)

after creating your jail setting an IP and choosing your source packages. (
I used FreeBSD-amd64-11.1-RELEASE-base.txz and FreeBSD-amd64-11.1-RELEASE-lib32.txz)

ssh into server

Code: Select all

jexec "jail number" csh

pkg install xtrans xextproto javavmwrapper flac openjdk gcc6 libtheora ffmpeg
After several minutes and several Yes's

Code: Select all

mkdir /var/subsonic
mkdir /var/subsonic/transcode
mkdir /var/subsonic/standalone

cp /usr/local/bin/flac /var/subsonic/transcode/
cp /usr/local/bin/ffmpeg /var/subsonic/transcode/
cd /var/subsonic/standalone
tar xvzf /tmp/subsonic-6.0-standalone.tar.gz
chmod 777 *.*

Code: Select all

sh /var/subsonic/standalone/subsonic.sh 
(this will start jail)
you should see this or simular

"Started Subsonic [PID 18319, /var/subsonic/subsonic_sh.log]"

Now go to the IP address you set in your jail and add port 4040 to address ie: 192.168.1.16:4040 if the server is running you can
user admin
pass admin

Now add your auto start script to the commands tab of XigmaNas

Started Subsonic [PID 18319, /var/subsonic/subsonic_sh.log]

Code: Select all

jexec "your_jail_name" /var/subsonic/standalone/subsonic.sh  make sure to set as a "postint" command!
Last edited by mrjacobrussell on 21 Aug 2018 05:16, edited 1 time in total.
11.2.0.4 - Omnius (revision 6766)
x64-embedded on Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz 16gb ram 15.4Tb pool storage

User avatar
mrjacobrussell
Starter
Starter
Posts: 62
Joined: 05 Jun 2015 17:57
Status: Offline

Re: [How To] Subsonic 6.0 in a Jail

Post by mrjacobrussell »

now go back to putty

Code: Select all

cd /mnt

mkdir (your media mount name)
for me I have several so for example I have one called mnt/red2tbone
you will need to make theses mounts before creating your FStab  entries for media shares. 

fstab manualy entered should look like

/mnt/mediadrive/ /mnt/(drive_where extensions_are_installed)/Extensions/thebrig/your_jail_name/mnt/mediadrive nullfs rw 0 0
11.2.0.4 - Omnius (revision 6766)
x64-embedded on Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz 16gb ram 15.4Tb pool storage

User avatar
mrjacobrussell
Starter
Starter
Posts: 62
Joined: 05 Jun 2015 17:57
Status: Offline

Re: [How To] Subsonic 6.0 in a Jail

Post by mrjacobrussell »

One more thing to add is that when you are messing with your subsonic install you should back up the data base folder.
inside the jail it is found at /var/subsonic/db

If you upgrade you can mv subsonic to subsonic.old then install new subsonic by un-taring the file then copy the db folder to /var/subsonic now start subsonic.
11.2.0.4 - Omnius (revision 6766)
x64-embedded on Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz 16gb ram 15.4Tb pool storage

Post Reply

Return to “Jails”