Bugzilla – Bug 17730
Server daemonizes repeatedly when restarting
Last modified: 2012-03-20 04:27:08 UTC
In sub stopServer, the server passes the --daemon flag on to its restarted version, and daemonizes again confusingly and unnecessarily: --- slimserver.pl.orig 2011-08-27 02:00:18.000000000 -0700 +++ slimserver.pl 2011-11-05 12:06:56.000000000 -0700 @@ -1074,6 +1074,7 @@ && Slim::Utils::OSDetect->getOS()->canRestartServer() && !main::ISWINDOWS) { + @argv = grep { $_ ne '--daemon' } @argv; exec($^X, $0, @argv); } An alternate approach might be to strip --deamon from the command line after daemonizing. This is already done for Darwin: --- slimserver.pl.orig 2011-08-27 02:00:18.000000000 -0700 +++ slimserver.pl 2011-11-05 12:10:19.000000000 -0700 @@ -917,10 +917,12 @@ open STDOUT, '>>/dev/null'; + # Do not attempt to daemonize again. + @argv = grep { $_ ne '--daemon' } @argv; + # On Leopard, GD will crash because you can't run CoreServices code in a forked child, # so we have to exec as well. if ( $^O =~ /darwin/ ) { - @argv = grep { $_ ne '--daemon' } @argv; exec $^X . ' "' . $0 . '" ' . join( ' ', @argv ); exit; }
Fixed as a side effect of cleanup done in 17729. r33893 *** This bug has been marked as a duplicate of bug 17729 ***