Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Oct 2001 13:20:13 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Eric Parusel <lists@globalrelay.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: FreeBSD Shutdown - Signal Timing?
Message-ID:  <20011002132013.A62998@dan.emsphone.com>
In-Reply-To: <020301c14b65$b1f6dbd0$57954c18@cns>
References:  <020301c14b65$b1f6dbd0$57954c18@cns>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Oct 02), Eric Parusel said:
>     I'm writing a perl script that has a long sleep cycle and a short
> processing cycle... During that processing cycle I'd like the script
> to ignore TERM's....
> 
> That brings up a pertinent question:
> 
> -  How long is the delay between the first (or only) TERM that is sent
> upon FreeBSD shutdown (I'm using RELENG_4_3 and RELENG_4_4) and the
> subsequent KILL, if needed, when FreeBSD get's impatient??

To avoid having to worry about this, you can add a shutdown script in
/usr/local/etc/rc.d that sends SIGTERM to your perl script, then waits
as long as necessary until it exits.  That way you can be sure your
perl script has exited cleanly.

You'll need to modify your perl script to not completely ignore
SIGTERM, but set an 'exit' flag so when your critical processing is
finished, it knows to exit instead of sleep.

-- 
	Dan Nelson
	dnelson@allantgroup.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011002132013.A62998>