[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Faster shutdown and the ubuntu "multiuser" update-rc.d extention



On Thu, Jan 03, 2008 at 02:45:40AM +0000, Colin Watson wrote:

> If this is a real problem for a given service, surely its init script
> should actually wait for the process to shut down cleanly? If so, it
> wouldn't be a candidate for this refactoring.

IMHO there can be many init scripts that currently do not wait for the
process to stop but they should if you want to do this refactoring. Some
random checks:

- samba: there is a sleep in "stop" but that may not be enough if
  there is heavy I/O. An explicit wait for process termination should be
  added.
- bind9: there is a sleep in "restart" but not in "stop". Killing
  named in the middle of say a zone transfer may not be nice, so waiting
  should be added.
- heimdal-kdc: waits in "restart" but not in "stop". Killing the KDC in
  the middle of a database update is not nice, so waiting should be added.
- squid: waits properly.
- acpid: there is a sleep in "restart" but not in "stop" and IMHO it
  does not need one - it can go without an explicit stop.
- chrony: there is a sleep in "restart" but not in "stop". AFAIK chrony
  writes the RTC status file on exit so it must not be killed before
  that's done.
- apache2: there is a (rather long) sleep in "restart" but not in
  "stop". Waiting for process termination should be added.

Also, in the proposed scheme sync() must be called _before_ sending the
final TERM signal since sync() may take longer than 5 seconds and
therefore heavy I/O may prevent even simple processes to shut down
properly between the final SIGTERM and SIGKILL.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------


Reply to: