NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
ludwich
Jun 26, 2012Aspirant
subsonic stops
My subsonic stops working every morning now after the new update =( I had the same problem before but there was a patch that made it work but now it stops every morning even when i dont restart the n...
pkas
Sep 21, 2012Tutor
I have a ReadyNAS Ultra 4+, and I have the subsonic server running on it. Everything worked great until a few days ago -- I can't be sure, though, if what I am about to describe only started after I upgraded the subsonic server from 4.7.02 to 4.7.03.
Every morning the subsonic service is no longer running. It turns out, that the readyNAS has a daily cron job -- and the service stops as a result of the cron job. I walked though the daily cron, and found that this one command causes the subsonic service to stop:
start-stop-daemon -K -n apache-ssl -R 5; /usr/sbin/apache-ssl -f /etc/frontview/apache/httpd.conf
The above line has two commands; the first command (start-stop-daemon -K -n apache-ssl -R 5) is what causes the subsonic service to stop.
Here's how I am working around the problem. You need to be able to ssh into the ReadyNAS, as root, so that you can modify /etc/cron.daily/logtruncate. Find the following lines in /etc/cron.daily/logtruncate:
Put the following lines BEFORE the above lines:
And put the following lines after the original lines:
In the end, this is what the section of code should look like:
I considered alternative approaches - such as just adding a cron job to see if subsonic is still running, regardless of why it stops. I might switch to that approach, because it would decouple the logtruncate script from subsonic, but for now I am using the approach shown above.
Phil
Every morning the subsonic service is no longer running. It turns out, that the readyNAS has a daily cron job -- and the service stops as a result of the cron job. I walked though the daily cron, and found that this one command causes the subsonic service to stop:
start-stop-daemon -K -n apache-ssl -R 5; /usr/sbin/apache-ssl -f /etc/frontview/apache/httpd.conf
The above line has two commands; the first command (start-stop-daemon -K -n apache-ssl -R 5) is what causes the subsonic service to stop.
Here's how I am working around the problem. You need to be able to ssh into the ReadyNAS, as root, so that you can modify /etc/cron.daily/logtruncate. Find the following lines in /etc/cron.daily/logtruncate:
foreach my $cmd (keys %restart) {
system("$cmd");
}
Put the following lines BEFORE the above lines:
my $subsonic = `ps aux | grep onic | grep jar | grep -v grep | sed -r -e 's/ +/ /g' | cut -f 11- -d ' '`; # PKAS
chomp($subsonic); # PKAS
And put the following lines after the original lines:
my $isSubsonicStillThere = `ps aux | grep onic | grep jar | grep -v grep`; # PKAS
if ($subsonic && $isSubsonicStillThere !~ /jar/) { # PKAS
print "Restarting subsonic\n"; # PKAS
system("cd /c/webroot/subsonic \&\& rm -f nohup.out \&\& nohup $subsonic 2>\&1 >/dev/null \&"); # PKAS
} # PKAS
In the end, this is what the section of code should look like:
my $subsonic = `ps aux | grep onic | grep jar | grep -v grep | sed -r -e 's/ +/ /g' | cut -f 11- -d ' '`; # PKAS
chomp($subsonic); # PKAS
foreach my $cmd (keys %restart) {
system("$cmd");
}
my $isSubsonicStillThere = `ps aux | grep onic | grep jar | grep -v grep`; # PKAS
if ($subsonic && $isSubsonicStillThere !~ /jar/) { # PKAS
print "Restarting subsonic\n"; # PKAS
system("cd /c/webroot/subsonic \&\& rm -f nohup.out \&\& nohup $subsonic 2>\&1 >/dev/null \&"); # PKAS
} # PKAS
I considered alternative approaches - such as just adding a cron job to see if subsonic is still running, regardless of why it stops. I might switch to that approach, because it would decouple the logtruncate script from subsonic, but for now I am using the approach shown above.
Phil
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!