V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
mhqschen
V2EX  ›  问与答

OS X 上 Aria2c 怎么开机自启动?

  •  
  •   mhqschen · 2016-04-22 22:13:39 +08:00 · 6133 次点击
    这是一个创建于 2962 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在 /Library/LaunchDaemons 下放了 aria2c.plist
    但没有自启动。是缺了什么还是下面的写错了?

    <?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>Aria2c</string>

    <key>Program</key>
    <string>/usr/local/Cellar/aria2/1.21.0/bin/aria2c</string>

    <key>KeepAlive</key>
    <true/>

    <key>NetworkState</key>
    <true/>

    <key>LaunchOnlyOnce</key>
    <true/>
    </dict>
    </plist>
    11 条回复    2016-04-23 12:35:19 +08:00
    isbase
        1
    isbase  
       2016-04-22 23:10:28 +08:00 via Android
    设置-用户-管理登录项
    rashawn
        2
    rashawn  
       2016-04-23 01:14:25 +08:00
    实在不行就开机启动 iterm iterm 启动 aria2c
    Wao
        3
    Wao  
       2016-04-23 04:29:20 +08:00
    自己用 Automator 写了个小脚本程序,然后添加到开机启动项里

    Valyrian
        4
    Valyrian  
       2016-04-23 05:49:17 +08:00 via iPhone
    没参数怎么运行,/Library/LaunchDaemon 里的是系统启动完运行的,根本看不到用户 home directory 的.aria2/aria2.conf
    需要登录完运行的进程,放到~/Library/LaunchAgents
    ETiV
        5
    ETiV  
       2016-04-23 06:06:20 +08:00 via iPhone
    光放进去是不行的,还得 lanchctl load 一下

    具体可以 Google 学习一下 os x lanchd
    Bardon
        6
    Bardon  
       2016-04-23 07:11:11 +08:00
    扔到 ~/Library/LaunchAgents
    launchctl load -w ~/Library/LaunchAgents/xxx.plist
    mhqschen
        7
    mhqschen  
    OP
       2016-04-23 09:57:02 +08:00
    @Wao 求下脚本~

    @Bardon 试了下,还是不行 T.T
    改了下内容,这个 plist 文件本身 OK 么?

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>Aria2c</string>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/Cellar/aria2/1.21.0/bin/aria2c</string>
    <string>--D</string>
    </array>
    </dict>
    </plist>
    n6DD1A640
        8
    n6DD1A640  
       2016-04-23 11:24:18 +08:00
    推荐用这个软件写启动服务, http://www.soma-zone.com/LaunchControl/
    Wao
        9
    Wao  
       2016-04-23 11:40:05 +08:00
    bazingaterry
        10
    bazingaterry  
       2016-04-23 11:47:54 +08:00
    4L 正解
    vizards
        11
    vizards  
       2016-04-23 12:35:19 +08:00
    拿 automater 写的
    https://userscloud.com/aonlutov2y36

    在偏好设置-用户与群组-登录项里面把这个 app 添加进去就好~
    ![]( https://ooo.0o0.ooo/2016/04/22/571afb64e7234.png)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   936 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:05 · PVG 05:05 · LAX 14:05 · JFK 17:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.