Move subsonic to different directory (Linux / Debian)

Tutorials, tips and tricks.

Moderator: moderators

Move subsonic to different directory (Linux / Debian)

Postby wurrrlitzer » Tue Oct 07, 2014 8:27 am

The following hints are for a Subsonic installation (deb package) on Debian.
If you're looking for hints on how to move the Subsonic home directory on a Windows server, you might find this posting useful: viewtopic.php?t=1421

Why I wanted to move?
I have a setup where the media/web server is a cubietruck which uses a memory card for its boot/root partition. I also have a big SATA drive attached to it.
For various reasons (reliability, writing cycles etc., beyond the scope of this tutorial) I wanted to move my Subsonic installation from the memory card to my "real" hard drive. Specifically: From /var/subsonic (which is located on the memory card) to a new directory called /data/subsonic (which is located on the sata hard drive).

How to move
Use the following hints at your own risk. So far it's been working for me without problems.

1. stop the subsonic service
Code: Select all
sudo service subsonic stop

2. move the subsonic home directory to your new preferred directory. in my case:
Code: Select all
sudo mv /var/subsonic /data

3. edit the script script which controls subsonic (start, stop etc) to reflect the directory change
Code: Select all
---- OPEN FILE
/usr/share/subsonic/subsonic.sh

---- FIND
SUBSONIC_HOME=/var/subsonic

---- REPLACE WITH (new directory. In my case the end result is)
SUBSONIC_HOME=/data/subsonic


4. (not sure if this is necessary at all, feedback is welcome) if Subsonic is configured to start while booting (which seems to be the case when you're installing the deb package), you might want to change the init script to reflect the change of directory:

Code: Select all
---- OPEN FILE
/etc/init.d/subsonic

---- FIND
chown $SUBSONIC_USER $PIDFILE
[ -e /var/subsonic ] && chown -R $SUBSONIC_USER /var/subsonic

---- REPLACE WITH (my example, change to your directory if you use a different one)
chown $SUBSONIC_USER $PIDFILE
[ -e /data/subsonic ] && chown -R $SUBSONIC_USER /data/subsonic


5. If, for security reasons, you decided to create a subsonic user to own and run subsonic, make sure your new directory is (recursively) owned by subsonic. in my case:
Code: Select all
sudo chown -R subsonic /data/subsonic


6. start the subsonic service
Code: Select all
sudo service subsonic start
wurrrlitzer
 
Posts: 4
Joined: Mon Sep 22, 2014 9:28 am

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest