TL;DR: I’ve a LaunchAgent that’s triggered with
WatchPaths that runs a quite simple/fast script and exits cleanly. However it finally ends up producing console log reminiscent of this:
Apr 25 19:30:45 my-clever-hostname com.apple.xpc.launchd (com.mytld.btautopair): Service solely ran for five seconds. Pushing respawn out by 5 seconds.
What is that this “respawn” enterprise? What does it imply that it’s pushing respawn out by 5 seconds? Is that this only a log message I can safely ignore? Is there a solution to silence it?
The factor is, every part is working as anticipated. The script is brief and candy.
The launch agent plist:
<?xml model="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Laptop//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist model="1.0"> <dict> <key>Label</key> <string>com.mytld.btautopair</string> <key>ProgramArguments</key> <array> <string>/Customers/myusername/Library/Scripts/bt_autopair.bash</string> </array> <key>WatchPaths</key> <array> <string>/Library/Preferences/com.apple.Bluetooth.plist</string> </array> </dict> </plist>
And the bash script it triggers:
#!/bin/bash # Keychron K1 keyboard id: dc-dc-22-55-12-8c # Magic Mouse "magictron": 78-ca-ca-ed-ed-27 if [[ $(/usr/local/bin/blueutil --is-connected dc-dc-22-55-12-8c) = 1 ]]; then if [[ $(/usr/local/bin/blueutil --is-connected 78-ca-ca-ed-ed-27) = 0 ]];then /usr/native/bin/blueutil --connect 78-ca-ca-ed-ed-27 fi else if [[ $(/usr/local/bin/blueutil --is-connected 78-ca-ca-ed-ed-27) = 1 ]];then /usr/native/bin/blueutil --disconnect 78-ca-ca-ed-ed-27 fi fi exit 0
Is there extra I may add to my launch agent
plist that may let
launchd know that I do not count on my agent/daemon to run lengthy in any respect?