Bug 5620 - Stopping SC7 leaves MySQL and mDNS running
: Stopping SC7 leaves MySQL and mDNS running
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Platform Support
: 7.0
: PC All
: P3 normal (vote)
: ---
Assigned To: Squeezebox QA Team email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-29 17:06 UTC by David Myers
Modified: 2008-12-18 11:12 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Myers 2007-09-29 17:06:55 UTC
Stopping SC7 on Fedora 7 terminates the Perl process, but MySQL and mDNS keep running.

You also get a failure message:

# service slimserver stop
Shutting down SqueezeCenter:                               [FAILED]


This is with the 9/28 nightly (though I think it's behaved this way since at least 8/31 when I started playing with version 7).
Comment 1 Kyle K. 2007-10-18 02:06:29 UTC
I can confirm this on my Fedora 7 box using the 10/17 nightly.

It requires me to do the following to properly shutdown:

/etc/init.d/slimserver stop
killall mysqld
killall mDNSResponderPosix

I noticed that the 'stop' function in the slimserver init.d script only attempts to kill the slimserver.pl process.  I couldn't find where it ever tries to kill these other dependent processes as well.
Comment 2 KDF 2007-10-25 17:10:09 UTC
*** Bug 5908 has been marked as a duplicate of this bug. ***
Comment 3 Mark Miksis 2007-10-27 11:23:16 UTC
I'm not sure if anyone is looking at this, but the following info may help.  While testing RPM changes, I noticed that this bug occurs on Red Hat, but not on SUSE.  In both cases, the init script is stopping squeezecenter with "killproc".  However, on RH killproc is a function in the file /etc/init.d/functions while on SUSE killproc is a binary in /sbin.

Has anyone seen this bug on non-linux?
Comment 4 Mark Miksis 2007-10-27 17:49:18 UTC
Any chance the original bug report is based on a VMWare instance or other unusually slow machine?  I think this is related to a race condition that will only happen on slow machines.  If so, I have a fix.
Comment 5 David Myers 2007-10-27 17:55:03 UTC
Yes, I'm running F7 under VMware, though the host machine isn't particularly slow (2.0 GHz Core 2 Duo).
Comment 6 Mark Miksis 2007-10-27 18:03:29 UTC
Cool.  Please try this:

In /etc/init.d/slimserver, look for this line in stop()
	killproc $SLIMSERVER_BIN
and change it to
	killproc -d 6 $SLIMSERVER_BIN

Actually, the default is "-d 3", so if possible try a few different values (between 4 and 10 or so) under different loads and let me know what works.  Note that if you have a bunch of old mDNSResponder instances from old restarts, this will only kill the current one.

Thanks!

Comment 7 David Myers 2007-10-27 18:33:38 UTC
I tried 6, 5, 4, and 3, and the processes terminated properly with all but 3 with the system lightly loaded.

I then tried varying load levels with 5 and it worked every time.

Comment 8 Mark Miksis 2007-10-27 21:20:51 UTC
Thanks.  Fixed in trunk and 6.5 as change 14150.
Comment 9 Kyle K. 2007-10-29 08:37:14 UTC
I can also confirm that this fix worked for me on my Fedora 7 box.  Thanks!
Comment 10 Mark Miksis 2007-11-05 08:50:42 UTC
Just a note that change 14150 breaks older RHEL and some current CC distros because killproc() doesn't support -d.  Change 14309 kludges around that.  I don't know how to fix this on those older distros.
Comment 11 Dan Evans 2007-11-16 09:29:12 UTC
This can be seen on Windows XP as well and continues to be an issues.  It may not be fixed in latest build.

(special branch build) SqueezeCenter Version: 7.0 - 14768 - Windows XP - EN - cp1252
Comment 12 Mark Miksis 2007-11-16 09:57:09 UTC
FWIW, the fix for the Linux RPM basically increases the delay between SIGTERM and SIGKILL to give the parent more time to kill the children.  I have no idea how any of this works on Windows...
Comment 13 Chris Owens 2007-11-16 16:39:56 UTC
Dan, would you open a separate bug for Windows?  You can note that the new bug is similar to this one by just referring back to "bug 5620".  Bugzilla will parse that string into a link.  

I think the two OSes are similar that if one or the other fails again in the future, or if this fix turns out not to be good, that we would be better off with separate bugs.  Thanks!

And thanks David and Kyle for verifying Fletch's fix!
Comment 14 KDF 2007-12-09 15:46:20 UTC
note: Michael may have just fixed this for windows as well in change 15124
Comment 15 Chris Owens 2008-03-07 09:04:57 UTC
This bug is being closed since it was resolved for a version which is now released!  Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html

If you are still seeing this bug, please re-open it and we will consider it for a future release.