Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

supervisord can't find command in virtualenv folder

My supervisord.conf contains a bunch of programs like so:

[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true

[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true

But sometimes when I restart supervisord, I get

can't find command venv/bin/gtaskqueue_puller

But when I cd into the directory and run the same command, it works as expected.

like image 940
john2x Avatar asked Apr 23 '13 13:04

john2x


1 Answers

Sometimes supervisor can't find command with relative path even if directory is setup.

So use:

[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=/root/scripts/gtaskqueue_puller/venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true

[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=/root/scripts/gtaskqueue_puller/venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true

rather than:

[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true

[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true
like image 183
Remiii Avatar answered Oct 19 '22 11:10

Remiii