[DGD] Re: What to do at interrupt() time?

Kris Van Hees aedil at alchar.org
Fri Jun 12 20:34:48 CEST 1998


On Fri, Jun 12, 1998 at 01:27:14PM -0500, Kevin Carpenter wrote:
> What I'm about to say is rather obvious, but here it is anyway:
> 
> I had hoped to use the interrupt() system to create a dump file when a
> Linux shutdown() was occuring.  Unfortunetly, on occassion I found the
> process was being killed (presumably by a cleanup kill -9) before the
> dump file was completely written.  This was not good...  I havn't given
> it any thought, but I'm going to have to do something in the Linux 
> shutdown sequence to allow DGD to completely shutdown prior to having
> its process caught in some cleanup routine.

The problem is that upon a shutdown Linux (like most Unix systems) actually
first sends all processes a TERM signal, and then after some delay (like 5
seconds), a KILL signal is sent.  So, if that last one arrives before the
dump is done, you experience the incomplete dump.

You could either change that delay into a test for the dump having been
finished, or better... write a shutdown script (ala /etc/init.d scripts in
SysV Unix) which does the kill to trigger the dump, and have that script
only terminate after the dump has been created.

Aedil



List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list