Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does launchd status 78 mean?? why my user agent not running??

I want to run a unison sync service running in the background whenever I login. But the status code of my agent is 78. I don't know why, I tried some fix posted online, but it just doesn't work.

What's the problem?? below is the plist file for my service.

<?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>syncmyproject</string>     <key>StandardOutPath</key>     <string>/var/log/syncmyproject.log</string>     <key>StandardErrorPath</key>     <string>/var/log/syncmyproject.log</string>     <key>RunAtLoad</key>     <true/>     <key>KeepAlive</key>     <true/>     <key>Debug</key>     <true/>     <key>EnableGlobbing</key>     <true/>     <key>ProgramArguments</key>     <array>       <string>/usr/local/bin/unison</string>       <string>-auto</string>       <string>-batch</string>       <string>-repeat watch</string>       <string>~/home/project</string>       <string>~/project</string>     </array> </dict> </plist> 
like image 560
Aaron Shen Avatar asked Dec 11 '15 03:12

Aaron Shen


2 Answers

I read man launchctl, find 78 means function not implemented. It doesn't help much.

Finally I make it work, actually there were errors in the plist, I recommend to install the brew install --cask launchcontrol, which is a gui tool for launchctl, it can help detect errors and trouble shooting.

like image 151
Aaron Shen Avatar answered Oct 04 '22 02:10

Aaron Shen


I found the error had to do with permissions. I was trying to redirect errors and logs to the /var/log directory which my user is not able to write to. Changing the path to something where my user had proper permissions to r+w fixed it.

Also, be careful when loading your LaunchAgents. Do not use sudo to load a plist if you are in the ~/Library/LaunchAgents directory.

like image 26
Brian McCall Avatar answered Oct 04 '22 01:10

Brian McCall