ExitTimeOut seems to be ignored in simple demo
I compiled a tool named "Beeper", which simply calls NSBeep() every second, in an infinite loop. I then loaded this job using launchctl: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ExitTimeOut</key> <integer>5</integer> <key>Label</key> <string>beeper.plist</string> <key>ProgramArguments</key> <array> <string>/Users/jk/Documents/Programming/Builds/Debug/Beeper</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> As expected, my computer begins beeping. Note that ExitTimeOut = 5. Expected Result: My tool should get a SIGKILL and quit beeping after 5 seconds. Actual Result: My tool keeps executing until I kill it with other means. What's wrong? Thanks, Jerry Krinock
On Aug 13, 2010, at 7:28 PM, Jerry Krinock wrote:
Note that ExitTimeOut = 5.
Expected Result: My tool should get a SIGKILL and quit beeping after 5 seconds. Actual Result: My tool keeps executing until I kill it with other means.
What's wrong?
I asked the same question earlier this year. You can read the response that is pretty clear on what is happening here... http://lists.macosforge.org/pipermail/launchd-dev/2010-January/000732.html In summary ExitTimeOut is referring to the time between when a SIGTERM is issued by launchd, e.g. someone asked for a launchd process to stop via launchctl, and when the SIGKILL is issued. Sincerely, Michael
On 2010 Aug 13, at 18:34, Michael Ledford wrote:
I asked the same question earlier this year. You can read the response that is pretty clear on what is happening here... http://lists.macosforge.org/pipermail/launchd-dev/2010-January/000732.html
In summary ExitTimeOut is referring to the time between when a SIGTERM is issued by launchd, e.g. someone asked for a launchd process to stop via launchctl, and when the SIGKILL is issued.
Thank you, Michael. Lord, have mercy. So I have just filed with Apple Bug Reporter Problem ID 8310103: "Documentation for Darwin launchd.plist(5) ExitTimeOut…".
There is also a TimeOut key (you can specify it in the plist, but it will be added to the job at runtime by launchd if you omit it) for what you're describing, but launchd doesn't enforce it. I have a tiny class, SSIdleTerminator, that I use for this purpose. I initialize it with the TimeOut provided by launchd at checkin. You can find it on GitHub at <http://github.com/Sidnicious/SSIdleTerminator>. On Fri, Aug 13, 2010 at 10:59 PM, Jerry Krinock <jerry@ieee.org> wrote:
On 2010 Aug 13, at 18:34, Michael Ledford wrote:
I asked the same question earlier this year. You can read the response that is pretty clear on what is happening here... http://lists.macosforge.org/pipermail/launchd-dev/2010-January/000732.html
In summary ExitTimeOut is referring to the time between when a SIGTERM is issued by launchd, e.g. someone asked for a launchd process to stop via launchctl, and when the SIGKILL is issued.
Thank you, Michael.
Lord, have mercy.
So I have just filed with Apple Bug Reporter Problem ID 8310103: "Documentation for Darwin launchd.plist(5) ExitTimeOut…".
_______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev
participants (3)
-
Jerry Krinock
-
Michael Ledford
-
Sidney San Martín