[launchd-dev] About the ExitTimeOut key in a daemon's configuration plist

Axel Luttgens axel.luttgens at skynet.be
Sat Mar 12 02:22:54 PST 2016


Hello,

From launchd.plist(5):

	ExitTimeOut <integer>
	The amount of time launchd waits between sending the SIGTERM
	signal and before sending a SIGKILL signal when the job is to be
	stopped. The default value is system-defined. The value zero is
	interpreted as infinity and should not be used, as it can stall
	system shutdown forever.

Since I’m considering a service that may sometimes need somewhat more time than the default wait time (10 seconds, IIRC), I tried with:

	<key>ExitTimeOut</key>
	<integer>60</integer>

in the service’s plist.

No problem with a "launchctl bootout": the daemon receives a TERM signal and shuts down cleanly.

But when rebooting the machine, it seems that the system doesn’t send a TERM signal: it just waits for sixty seconds, then KILLs the daemon.

On the other hand, without the ExitTimeOut key in the plist, the TERM signal is sent to the daemon upon reboot (as expected).

This is with Mac OS X 10.11.3.

Am I misunderstanding the role of that ExitTimeOut key?

TIA,
Axel



More information about the launchd-dev mailing list