The*_*net 1 macos osx-lion launch-daemon
我正在尝试在启动时在我的机器上运行可执行文件(mbp retina osx mountain lion).
这是脚本的样子:
<?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.netresponsibility.daemon</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/net-responsibility</string>
<string>--daemon</string>
</array>
<key>OnDemand</key>
<true/>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)
我把它放在/ System/Library/LaunchDaemons /目录中.它的名称com.netresponsibility.daemon.plist和权限与其他所有权限相同.
-rw-r--r-- 1 root wheel 420 Oct 11 12:39 com.netresponsibility.daemon.plist
Run Code Online (Sandbox Code Playgroud)
当我重新启动时,不会调用可执行文件.关于我缺少什么的任何想法?
首先,你不应该在/ System/Library中放任何东西.该路径是为OS X文件保留的.您应该将文件放在/ Library/LaunchDaemons /中.
其次,你需要告诉系统加载你的plist,仅仅把它放在那里是不够的.为此,您使用launchctl:
$ sudo launchctl load -w /Library/LaunchDaemons/com.netresponsibility.daemon.plist
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请发送电子邮件.
| 归档时间: |
|
| 查看次数: |
4574 次 |
| 最近记录: |