Bugzilla – Bug 17729
Fedora service control fumbles after server restart
Last modified: 2012-03-21 02:32:32 UTC
My server is installed on Fedora as a service which is controlled via: service squeezeboxserver { start | stop } See http://svn.slimdevices.com/repos/slim/7.6/trunk/platforms/fedora/SOURCES/slimserver.init I discovered that the service control is unable to stop the server if the server previously been restarted (eg a plugin had previously been installed). The root cause is that pidof(8) is unable to find the newly minted server for the following reasons: pidof(8) is looking for a script by comparing comm field in /proc/<pid>/stat with the basename of argv[1]. When started as a service, the server relies on the #! in slimserver.pl to run the script. This causes the executable to have a comm value of (slimserver.pl). When the server restarts itself, it uses the command line equivalent of "perl slimserver.pl ..." and the newly minted instances gets a comm field value of (perl). pidof(8) can no longer find the script process running the server.
A duplicate bug https://bugs-archive.lyrion.org/show_bug.cgi?id=15523
*** Bug 15523 has been marked as a duplicate of this bug. ***
*** Bug 13664 has been marked as a duplicate of this bug. ***
Created attachment 7592 [details] Proposed patch against 7.7 trunk http://forums.slimdevices.com/showthread.php?t=91595
Add Andy to cc as per http://forums.slimdevices.com/showpost.php?p=674973&postcount=20
A few comments about that patch: - when calling restartServer() we must not stop the server if it can't be restarted - for the sake of legibility I'd change the OSX restart routing to use a regular if... else... statement - any good reason to remove the early return with warning on systems running perl on Windows? - $::stop = 1; should be left in (slimserver.pl) to tell the main loop that we want to stop
Would using $0 to set the process name work too? Might be simpler.
(In reply to comment #7) > Would using $0 to set the process name work too? Might be simpler. Writing to $0 doesn't necessarily invoke PR_SET_NAME. http://www.gossamer-threads.com/lists/perl/porters/249164 http://search.cpan.org/~opi/Sys-Proctitle-0.04/lib/Sys/Proctitle.pm
See
*** Bug 17440 has been marked as a duplicate of this bug. ***
== Auto-comment from SVN commit #33898 to the slim repo by mherger == == http://svn.slimdevices.com/slim?view=revision&revision=33898 == Bug: 17729 Description: apply patch to clean up restart behaviour - thanks quiet.dragon!
*** Bug 17730 has been marked as a duplicate of this bug. ***
Verified on a CentOS 4 based system.
Verified on Windows 7 & OSX 10.5
Nope none of the issues are fixed on ClarkConnect 4.2 Linux # service squeezeboxserver restart /sbin/service: line 68: 22339 Terminated env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} Restart does not work . Start after install does not work And I cant leave the ssh session in a nice way Essentially the same as it was when 7.4 was introduced https://bugs-archive.lyrion.org/show_bug.cgi?id=13664 this bug is marked as a duplicate of this one ? I would not call it fixed. Rebooting the server still works
Which exact build did you install? This is in 7.8 only, not in 7.7.2. Please note that the first shutdown/restart probably will fail, as you're still running the old version.
I installed: Logitech Media Server Version: 7.8.0 - r33899 @ Tue Mar 20 10:16:14 MDT 2012 Hostname: hal.home.lan Server IP Address: 192.168.1.5 Server HTTP Port Number: 9000 Operating system: Red Hat - EN - utf8 Platform Architecture: i686-linux Perl Version: 5.8.8 - i686-linux-thread-multi Database Version: DBD::SQLite 1.34_01 (sqlite 3.7.7.1) Total Players Recognized: 4
Mikael - I re-opened your bug, which indeed is something different. Let's continue discussion there. Thanks!