On 01.12.2012 21:11, Steve Langasek wrote: > On Sat, Dec 01, 2012 at 10:39:35PM +0800, Thomas Goirand wrote: > >> More over, most of the sleep calls you will find in init scripts (and I >> believe that is what your grep shows, because that's the case on my own >> laptop...) are because of: > >> case "${1}" in >> restart|reload|force-reload) >> ${0} stop >> sleep 1 >> ${0} start >> ;; > >> which I don't think is (so much of) a problem in itself. Unless you >> also consider the above as a race condition (which, really, could >> be a real one...). > > Those are also race conditions, and bugs. If the stop and start commands > return control before the action is completed, the results cannot be relied > on. The 'restart' command is not the only way that an admin may > programmatically stop and start a service; you might do this with something > based on puppet, for instance, with the intent of having the service fully > stopped before you edit its state, then restart it afterwards, so a race > here can even lead to corruption. >
I did a test with all 1194 sysv init scripts we currently have in Debian: # grep "\<sleep\>" * | wc -l 1101 This is just sad :-/ -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature