我正在尝试使用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
答案 0 :(得分:42)
您的文件需要可执行。所以:
chmod +x
设置可执行位。ENOEXEC
。或
command=sh /var/application/start_tester
。答案 1 :(得分:1)
在大多数情况下,shebang通常会丢失。
- #!/usr/bin/env bash
- #!/bin/bash
- #!/bin/sh
- #!/bin/sh -
一旦将shebang添加到gunicorn_start文件中(对于DJANGO), 重新启动主管
sudo systemctl enable supervisor
sudo systemctl restart supervisor