• launchctl


    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工具, 配置起来方便
  • 相关阅读:
    关于最近
    Cryptography Application Block
    关于修改SQL SERVER 登陆模式
    我与软件工程
    JAVA之路(一)
    C#基础:类的继承与多态
    简述java语言的特点
    简述java虚拟机的工作原理
    阿里云盾特点及防DDoS攻击服务介绍
    智能DNS
  • 原文地址:https://www.cnblogs.com/megachen/p/9692561.html
Copyright © 2020-2023  润新知