首页 > 其他 > 详细

launchctl

时间:2018-09-23 14:27:02      阅读:186      评论:0      收藏:0      [点我收藏+]

Launchctl

  • 系统启动时, 系统会以root用户的身份扫描/System/Library/LaunchDaemons和/Library/LaunchDaemons目录, 如果文件中有Disable的值为true, 则不会load进来, 否则就会load进来, 相当于执行了launchctl load -w path
  • 用户登录时, 该用户会扫描/System/Library/LaunchAgent, /Library/LaunchAgent 和 ~/Library/LaunchAgent目录下的plist文件, 是否加载load取决于Disable键的值
  • launchd的load与start是不一样的, 取决于RunAtLoad键的值, 如果true, 则表示load之后立马启动
  • 一个简单的plist文件需要有Label(域名反写, 会在Launchctl list显示出来), Program, ProgramArguments, RunAtLoad(为true表示load时启动), Disable, StandardInPath, StandardOutPath, StandardErrorPath, StartInterval(几秒钟执行一次), WorkdingDirectory(临时目录是哪个)
  • launchctl load ... ; launchctl unload ... ; launchctl start ... ; launchctl stop
  • 如果配置文件中指明了Disable的话, 则需要-F强制load
  • 使用LaunchControl工具, 配置起来方便

launchctl

原文:https://www.cnblogs.com/megachen/p/9692561.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!