mac os 启动服务命令 launchctl

mac os 启动服务命令 launchctl,第1张

mac os 启动服务命令 launchctl

参考苹果开发者网址

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>

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/586833.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-12
下一篇 2022-04-12

发表评论

登录后才能评论

评论列表(0条)

保存