john2x
john2x

Reputation: 23634

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.

Upvotes: 6

Views: 7211

Answers (1)

Remiii
Remiii

Reputation: 1142

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

Upvotes: 8

Related Questions