Question

I create bash to run python script start_queue.sh

content of start_queue.sh

python /tmp/my_python_script.py & 

It's work when I run it in terminal. But I want to manage it using supervisord since I have few django website already manage by supervisord.

But I just get the error when start

supervisor: couldn't exec /tmp/start_queue.sh: ENOEXEC
supervisor: child process was not spawned

This is how i config in supervisord

[group:scriptgroup]
programs=script_1

[program:script_1]
command=/tmp/start_queue.sh
directory=/tmp/
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/x.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=50
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
loglevel=info

It's possible to manage a backgroup process by supervisord, What did i wrong here. Please help.

Was it helpful?

Solution

Add #!/bin/sh at the beginning of script.

OTHER TIPS

You need to execute your shell script spawned. Spawn means when you kill it, it doesn't kill unless a set of cicumstances to be.

notes: supervisor is a python module that control proocessing. For more see this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top