Bug 17708 - squeezecenter_safe does not wait for squeezecenter-binary to die
: squeezecenter_safe does not wait for squeezecenter-binary to die
Status: UNCONFIRMED
Product: Logitech Media Server
Classification: Unclassified
Component: Platform Support
: 7.7.0
: Other Linux (other)
: -- normal (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-28 05:17 UTC by ryz
Modified: 2011-12-11 06:33 UTC (History)
0 users

See Also:
Category: Bug


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ryz 2011-10-28 05:17:07 UTC
When the squeezecenter_safe script gets a signal to stop the squeezecenter-binary it just send a kill to the binary and then immediately exits regardless how long time it takes for the squeezecenter-binary to quit. This means that the init script that uses squeezecenter_safe script will think that squeezecenter is always stopped immediately. There is a big risk that when doing an restart the init script will start a new squeezecenter-binary before the old one has exit.

The fix i quit simple just change the code

 function clean_up {
  # Kill the SqueezeCenter daemon if it is running
  kill $SLIMPID
  echo `date "+%F %H:%M:%S"` "squeezecenter_safe stopped." >> /var/log/squeezecenter/server.log
  exit
}

to

}function clean_up {
  # Kill the SqueezeCenter daemon if it is running
  kill $SLIMPID
  echo `date "+%F %H:%M:%S"` "squeezecenter_safe stopped." >> /var/log/squeezecenter/server.log
  wait $SLIMPID
  exit $?
}