supervisord exiting with ENOEXEC

可紊 提交于 2019-12-20 18:01:38

问题


I am trying to run a java process with supervisord and am getting:

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

The contents of start_tester is:

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

When I run the script from the console the app runs as expected. Here is my supervisor config

[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

When I run the script from the console this is the output:

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

回答1:


Your file needs to be executable. So either:

  1. You should chmod +x it to set the executable bit.
  2. Put a shebang at the start of the file. Not having this is what caused the ENOEXEC.

or

  1. Modify your config file to something like command=sh /var/application/start_tester.



回答2:


In most cases a shebang is usually missing.

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

Once you add the shebang to your gunicorn_start file (in case of DJANGO), restart the supervisor

sudo systemctl enable supervisor 
sudo systemctl restart supervisor


来源:https://stackoverflow.com/questions/19285666/supervisord-exiting-with-enoexec

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!