简体   繁体   中英

launchd ExitTimeOut doesn't work

I Have a plist file with some job:

<dict>
    <key>Label</key>
    <string>StartScript</string>
    <key>Program</key>
        <string>/Users/ie54553/Desktop/script.sh</string>

    <key>StartInterval</key>
        <integer>10</integer>

    <key>ExitTimeOut</key>
        <integer>30</integer>

    <key>StandardOutPath</key>
        <string>/tmp/Out.log</string>
    <key>StandardErrorPath</key>
        <string>/tmp/Err.log</string>
</dict>

The problem is that the script.sh is being executed each 10 sec over and over, and doesn't stop the execution after the ExitTimeOut time (30 sec)

From some reason the ExitTimeOut doesnt work ...

Any idea how I can kill the job / execution ?

Tanks

This is not what ExitTimeOut is for. When unloading a job launchd sends the signal SIGTERM to the process. Should the job not terminate within ExitTimeOut seconds (20 seconds by default), launchd will send signal SIGKILL to force-quit it.

launchd has no means to terminate a job after a given timeout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM