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

求助: aria2 无法后台, aria2c -D、daemon=true 无效

  •  
  •   la0wei · 2017-07-09 09:00:09 +08:00 · 9455 次点击
    这是一个创建于 2490 天前的主题,其中的信息可能已经有所发展或是发生改变。
    https://github.com/q3aql/aria2-static-builds 下载的编译好的 arm 版本,也尝试了曾经可以 daemon 的历史版本,均不可行。
    运行环境为 netgear RN102 readynas
    uname -a 显示 Linux nas-35-EF-6F 4.4.68.armada.1 #1 SMP Wed May 31 17:40:50 PDT 2017 armv7l GNU/Linux

    单独执行 aria2c 有提示信息,可下载可 web 使用 rpc
    但是 aria2c -D 或者在 aria2c --daemon=true 或在 aria2.conf 中加入 daemon=true 均无法后台。
    ps、top 等均看不到进程,netstat 看不到 6800 端口监听。

    麻烦的是,不知道哪里查看相关日志,/var/log 下没有看到有用的信息。
    aria2 官方文档中也写
    Run as daemon. The current working directory will be changed to / and standard input, standard output and standard error will be redirected to /dev/null. Default: false

    似乎是说 daemon 模式下标准输入输出及标准错误信息会重定向到 /dev/null,那即是说看不到错误?

    有没有什么办法来排查这个问题,或者只能 screen 之类的来伪后台?
    7 条回复    2017-07-09 18:12:47 +08:00
    weyou
        1
    weyou  
       2017-07-09 09:04:48 +08:00 via Android
    配置文件里可以设置 log file。 查下是不是权限问题,在相同的用户下,分别不用-D 和用-D 跑下试试
    shengyu
        2
    shengyu  
       2017-07-09 09:15:07 +08:00 via iPhone
    同样问题,直接 nohup 了
    la0wei
        3
    la0wei  
    OP
       2017-07-09 09:31:33 +08:00
    @weyou 相同配置文件,不带 D 多出之前未下载完成任务信息,前面部分完全一致,没有别的有效信息。多出
    2017-07-08 18:24:23.788374 [NOTICE] [Context.cc:310] Downloading 6 item(s)
    2017-07-08 18:24:23.790107 [INFO] [HttpListenCommand.cc:106] CUID#7 - Using port 6800 for accepting new connections
    2017-07-08 18:24:23.790243 [NOTICE] [HttpListenCommand.cc:108] IPv4 RPC: listening on TCP port 6800
    2017-07-08 18:24:23.870513 [INFO] [LibsslTLSContext.cc:289] Trusted CA certificates were successfully added.
    2017-07-08 18:24:27.095123 [NOTICE] [DownloadEngine.cc:248] Shutdown sequence commencing... Press Ctrl-C again for emergency shutdown.
    2017-07-08 18:24:27.095634 [DEBUG] [RequestGroup.cc:1172] GID#404a06669f619c9c - Creating DownloadResult.

    相同配置,不带 D 可以运行,配置文件差异只有 daemon=true 的话,不带的可以运行,总之不能 daemon
    tywtyw2002
        4
    tywtyw2002  
       2017-07-09 09:56:45 +08:00
    你自己用 c 写个简单的 daemon 程序,有可能是 daemon 权限问题。 我曾经遇到过无法 daemon 的环境。
    la0wei
        5
    la0wei  
    OP
       2017-07-09 10:02:51 +08:00
    @tywtyw2002 再简单的也搞不定,已经在 gayhub 提交 issue 了,要不用 screen
    mh4cx3r
        6
    mh4cx3r  
       2017-07-09 12:35:32 +08:00 via Android
    看看是不是内存太少进程被 oom killer 杀了?再查看下系统日志之类,内核 oom 有时有点迷,即使内存够也会杀进程
    la0wei
        7
    la0wei  
    OP
       2017-07-09 18:12:47 +08:00
    @mh4cx3r 虽然只有 512 内存,剩余应该够了
    total used free shared buffers cached
    Mem: 496 340 156 1 17 244
    -/+ buffers/cache: 78 417
    Swap: 511 0 511
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2019 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 01:36 · PVG 09:36 · LAX 18:36 · JFK 21:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.