Probably most of the programs does handle SIGTERM appropriately, but it may be too little time for a program to clean itself before it receives SIGKILL signal. For an example mysql. It needs to kill any connections to it (and if any problem killing it, it should wait for some time and then try again), sync data, remove socket (I don't know the exact order of mysql shutdown task and I'm only guessing). And what if SIGKILL arrives in the middle of the mysql shutdown tasks?
Hannah Schroeter wrote: Hi! On Wed, Sep 19, 2007 at 02:48:54PM +0300, Tomas wrote: Watching the thread about startup script I thought of a question about shutdown script. Is it necessary to shutdown certain services when machine goes down? Like for example mysql, dovecot, clamav, amavis or openvpn. I've never saw anybody do that. Lots of people on their manuals, tutorials or posts writes how to start mysql, but none of then writes a shutdown script. So maybe it is not so necessary? (But then again, mysql is a database engine, and databases should be handle with care). Probably most programs that need non-trivial cleanup handle SIGTERM appropriately. Kind regards, Hannah.