【问题标题】:supervisord exiting with ENOEXECsupervisord 与 ENOEXEC 一起退出
【发布时间】:2013-10-17 14:48:24
【问题描述】:

我正在尝试使用 supervisord 运行一个 java 进程并得到:

couldn't exec /var/application/start_tester: ENOEXEC

start_tester的内容是:

java -Duser.dir=/var/application/ -cp /var/application/application.jar:/var/application/toepoke.jar com.application.Application

当我从控制台运行脚本时,应用程序按预期运行。这是我的主管配置

[program:application_tester]
directory=/var/application
command=/var/application/start_tester         ; the program (relative uses PATH, can take args)
log_stdout=true             ; if true, log program stdout (default true)
log_stderr=true             ; if true, log program stderr (def false)
logfile=/var/log/application_tester.log

当我从控制台运行脚本时,这是输出:

[root@monitor application]# ./start_tester 
20131009 203657: application starting up.
20131009 203657 (33): version 2.2.3

【问题讨论】:

    标签: supervisord


    【解决方案1】:

    您的文件必须是可执行的。所以要么:

    1. 你应该chmod +x它来设置可执行位。
    2. 在文件开头放置一个 shebang。没有这个是导致ENOEXEC 的原因。

    1. 将您的配置文件修改为command=sh /var/application/start_tester 之类的内容。

    【讨论】:

    • 就我而言,shebang 不见了。
    • 感谢 Gagandeep。 shebang也是我的缺失线。我还要补充一点,在包含 shebang 行后,您需要重新启用并重新启动主管才能使其工作: sudo systemctl enable supervisor sudo systemctl restart supervisor
    【解决方案2】:

    在大多数情况下,通常缺少一个 shebang。

      - #!/usr/bin/env bash
      - #!/bin/bash
      - #!/bin/sh
      - #!/bin/sh -
    

    将 shebang 添加到 gunicorn_start 文件后(如果是 DJANGO), 重启主管

    sudo systemctl enable supervisor 
    sudo systemctl restart supervisor
    

    【讨论】:

      猜你喜欢
      • 2016-02-17
      • 1970-01-01
      • 2012-05-26
      • 1970-01-01
      • 1970-01-01
      • 2014-03-28
      • 2014-04-07
      • 1970-01-01
      • 2015-05-10
      相关资源
      最近更新 更多