Bug 9007 - Issues with /etc/init.d/squeezecenter for Redhat based releases
: Issues with /etc/init.d/squeezecenter for Redhat based releases
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.1
: PC RedHat Linux
: -- normal (vote)
: 7.x
Assigned To: Mark Miksis
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-03 14:02 UTC by Andy Brown
Modified: 2009-07-31 10:26 UTC (History)
5 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Brown 2008-08-03 14:02:00 UTC
Issues seen on ClarkConnect 4.2

Problems seen with /etc/init.d/squeezecenter as follows (only for Redhat)

1 - Logic Wrong for condrestart

condrestart() {
[ -f $LOCKFILE ] && restart || :
}

But this should be:

condrestart() {
[ ! -f $LOCKFILE ] && restart || :
}

This is causing issues with logrotate killing Squeezecenter processes (due to incorrect logic in point 1)

--------------

2 - restart does not wait for processes to stop before starting again. Result is a failed restart.

Increasing the sleep in line 89 of /etc/init.d/squeezecenter from 2 to 10 resolves the issue.


Discussion on forum at following link:
http://forums.slimdevices.com/showthread.php?t=50605
Comment 1 Mark Miksis 2008-08-03 23:15:59 UTC
Someone from SD, please assign this to me.

(In reply to comment #0)
> Problems seen with /etc/init.d/squeezecenter as follows (only for Redhat)
> 
> 1 - Logic Wrong for condrestart
> 
> condrestart() {
> [ -f $LOCKFILE ] && restart || :
> }
> 
> But this should be:
> 
> condrestart() {
> [ ! -f $LOCKFILE ] && restart || :
> }

Why do you think this?  The point of this section is to check if SC is already running and only restart if it already is.  I think this works as expected.

> 2 - restart does not wait for processes to stop before starting again. Result
> is a failed restart.
> 
> Increasing the sleep in line 89 of /etc/init.d/squeezecenter from 2 to 10
> resolves the issue.

I'll do some testing with different values on different RPM based distros.  Are you running on real hardware or a VM?

Comment 2 Andy Brown 2008-08-04 10:58:01 UTC
(In reply to comment #1)
> Someone from SD, please assign this to me.
> 
> (In reply to comment #0)
> > Problems seen with /etc/init.d/squeezecenter as follows (only for Redhat)
> > 
> > 1 - Logic Wrong for condrestart
> > 
> > condrestart() {
> > [ -f $LOCKFILE ] && restart || :
> > }
> > 
> > But this should be:
> > 
> > condrestart() {
> > [ ! -f $LOCKFILE ] && restart || :
> > }
> 
> Why do you think this?  The point of this section is to check if SC is already
> running and only restart if it already is.  I think this works as expected.

OK - to be fair this was based on dem's comments on the forum. If there is a need to restart every time the logs rotate then fair enough (assuming the fix for the restart is in place).

> 
> > 2 - restart does not wait for processes to stop before starting again. Result
> > is a failed restart.
> > 
> > Increasing the sleep in line 89 of /etc/init.d/squeezecenter from 2 to 10
> > resolves the issue.
> 
> I'll do some testing with different values on different RPM based distros.  Are
> you running on real hardware or a VM?
> 

My testing is on a physical server (Pentium D 3.0 Ghz, 2GB RAM).  I picked 10 seconds as a first stab - its not necessarily the minimum for my PC (will do some more testing on this if I get chance).
Comment 3 Blackketter Dean 2008-08-04 12:41:54 UTC
Ping Fletch, what's the plan here for 7.2?
Comment 4 Mark Miksis 2008-08-04 14:34:20 UTC
(In reply to comment #3)
> Ping Fletch, what's the plan here for 7.2?
> 

I won't have time to test it for another day or so, but it should be trivial.  Hopefully that's soon enough to still go into 7.2.  My assumption is that something in 7.1 causes SC to shutdown a bit slower than 7.0.  Since my suggestion to the bug reporter about changing "sleep 2" works, I'm pretty sure I'm right.  (I can't really remember how I came up with 2 as the right delay in the first place.)

Anyway, I can't reproduce this on my main CentOS 5 server running 7.2, but it's a pretty fast machine.  I'd like to do a few tests on VMWare running various RPM based distros before committing the fix.
Comment 5 Mark Miksis 2008-08-05 15:08:49 UTC
I can't reproduce this on CC, CentOS or Fedora.  Andy Brown, what's the smallest sleep value that works reliably for you?
Comment 6 Andy Brown 2008-08-06 05:59:08 UTC
(In reply to comment #5)
> I can't reproduce this on CC, CentOS or Fedora.  Andy Brown, what's the
> smallest sleep value that works reliably for you?
> 

Ok - Have tested this now....the smallest sleep value that works reliably for me is 4.
Comment 7 Mark Miksis 2008-08-06 08:22:16 UTC
Changed to sleep 5 in change 22418 in 7.2/trunk.
Comment 8 David Myers 2008-08-16 05:51:53 UTC
> Why do you think this?  The point of this section is to check if SC is already
> running and only restart if it already is.  I think this works as expected.

OK, I was assuming the opposite (restart it only if stopped) since this was causing my SC to be restarted every night.

Comment 9 James Richardson 2008-12-15 12:05:49 UTC
This bug has been fixed in the 7.3.0 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 10 Chris Owens 2009-07-31 10:26:25 UTC
Reduce number of active targets for SC