I am loading a c binary using launchd service. It should be relaoded every time when system restarts. Below is my plist file:
<?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>Label</key> <string>com.example</string> <key>ProgramArguments</key> <array> <string>/etc/example/usr/sbin/example_cbinary</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> </dict> </plist>
Some times, it is exiting with 78 exit code.
launchctl list | grep example - 78 com.example
I am unable to find root cause for this. As this happens once in hundred times. To resolve this i am unloading and loading this service. I wanted it to automatically unload and load whenever it exits with 78 status.
Any help is highly appreciable
Thanks in Adavance