mhqschen
V2EX  ›  问与答

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

  •  
  •   mhqschen · Apr 22, 2016 · 6633 views
    This topic created in 3674 days ago, the information mentioned may be changed or developed.
    在 /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 replies    2016-04-23 12:35:19 +08:00
    isbase
        1
    isbase  
    PRO
       Apr 22, 2016 via Android
    设置-用户-管理登录项
    rashawn
        2
    rashawn  
       Apr 23, 2016
    实在不行就开机启动 iterm iterm 启动 aria2c
    Wao
        3
    Wao  
       Apr 23, 2016
    自己用 Automator 写了个小脚本程序,然后添加到开机启动项里

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

    具体可以 Google 学习一下 os x lanchd
    xmgit
        6
    xmgit  
       Apr 23, 2016
    扔到 ~/Library/LaunchAgents
    launchctl load -w ~/Library/LaunchAgents/xxx.plist
    mhqschen
        7
    mhqschen  
    OP
       Apr 23, 2016
    @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  
       Apr 23, 2016
    推荐用这个软件写启动服务, http://www.soma-zone.com/LaunchControl/
    bazingaterry
        10
    bazingaterry  
       Apr 23, 2016
    4L 正解
    vizards
        11
    vizards  
       Apr 23, 2016
    拿 automater 写的
    https://userscloud.com/aonlutov2y36

    在偏好设置-用户与群组-登录项里面把这个 app 添加进去就好~
    ![]( https://ooo.0o0.ooo/2016/04/22/571afb64e7234.png)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5948 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 141ms · UTC 02:14 · PVG 10:14 · LAX 19:14 · JFK 22:14
    ♥ Do have faith in what you're doing.