|
参考苹果开发者网址
https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html
1 max 终端下 >launchctl help , 查看命令帮助
2 比如我要开机启动 php-fpm,在
在/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.yangyz.memcached.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/start-memcached</string>
</array>
<key>KeepAlive</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/memcached.err</string>
<key>StandardOutPath</key>
<string>/tmp/memcached.out</string>
</dict>
</plist> |
|
|
|
|
|
|