7
无法在Yosemite中使用launchctl启动守护程序
我在其中放置了一个启动的守护进程,~/Library/LaunchAgents该守护进程在Mavericks中运行良好。但这不会在优胜美地公开测试版中开始。守护程序plist就像这样(我的用户名darksair使用UID 501) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd > <plist version="1.0"> <dict> <key>Label</key> <string>org.darksair.retrmail</string> <key>ProgramArguments</key> <array> <string>/Users/darksair/bin/retrmail.py</string> </array> <key>KeepAlive</key> <false/> <key>StartInterval</key> <integer>300</integer> <key>LaunchOnlyOnce</key> <false/> <key>UserName</key> <string>darksair</string> <key>ProcessType</key> <string>Standard</string> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/Users/darksair/Python/bin:/Users/darksair/Python3/bin:/Users/darksair/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string> </dict> <key>StandardOutPath</key> <string>/Users/darksair/logs/retrmail.log</string> <key>StandardErrorPath</key> <string>/Users/darksair/logs/retrmail.log</string> </dict> </plist> 基本上应该~/bin/retrmail.py每5分钟运行一次。 我注意到在Yosemite中,launchd已升级到2.0,并且launchctl具有新命令。我试过了 sudo launchctl kickstart user/501/org.darksair.retrmail …