Launchdd doesn't start my daemon

I am trying to find out why my daemon does not start automatically (on Mac 10.8.3). However, it works well on other machines. Here is my plist under / Library / LaunchDaemons /

<?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.MyApp.tmsm.launcher</string> <key>ProgramArguments</key> <array> <string>/Library/Application Support/MyApp/tmsmLauncher</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <false/> <key>StartInterval</key> <integer>60</integer> </dict> </plist> 

I did not see error messages in /var/log/system.log . I checked the permission and owner my daemon . If I put my layer under /System/Library/LaunchDaemons/ , it can be run after reboot . But this is not a good solution for me. If I use " launchctl load /Library/LaunchDaemons/com.MyApp.tmsm.launcher ", it works well. If I install other commercial software that is a daemon and has a plist under /Library/LaunchDaemons/ , it also cannot be started.

It seems that any plist under /Library/LaunchDaemons/ not loaded by the system. I am also trying to enable the launchctl debug level using the command " launchctl log level debug ", but there are no more messages after the reboot. Is the debugging level reset after reboot? Are there any other magazines or configs that I can check?

Thanks.

+4
source share
2 answers

Try loading it with the -w option: sudo launchctl load -w /Library/LaunchDaemons/blablabla.plist . Looks like a problem in the Disabled key. see man launchctl for more details.

If this does not work, I suggest you include some entries in the file for your daemon to see if it starts (maybe it exits right away?)

+4
source

I found the main reason ... This is pretty stupid ... The permission of my plist under / Library / LaunchDaemons / is correct. However, the permission of / Library / LaunchDaemons / is changed to 755. That is why any daemons registered in / Library / LaunchDaemons / cannot be loaded automatically ...

0
source

Source: https://habr.com/ru/post/1483318/


All Articles