2013-04-23 35 views
6

My supervisord.conf chứa một loạt các chương trình như vậy:supervisord không thể tìm thấy lệnh trong thư mục virtualenv

[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 

Nhưng đôi khi tôi khởi động lại supervisord, tôi nhận được

can't find command venv/bin/gtaskqueue_puller 

Nhưng khi tôi cd vào thư mục và chạy cùng một lệnh, nó hoạt động như mong đợi.

+1

bạn có thể cung cấp đường dẫn tuyệt đối đến venv/bin? giám sát conf cung cấp chỉ thị 'thư mục' http://supervisord.org/configuration.html – dm03514

+2

Có, tôi đã đặt tùy chọn' thư mục'. Chỉ cần thử sử dụng đường dẫn đầy đủ trong lệnh và nó hoạt động. Kỳ dị. – john2x

+0

Tôi có thể thấy hành vi tương tự - đôi khi người giám sát không thể tìm thấy lệnh có đường dẫn tương đối ngay cả khi thư mục được đặt và bạn có thể chạy lệnh từ thư mục này theo cách thủ công. –

Trả lời

6

Đôi khi người giám sát không thể tìm thấy lệnh có đường dẫn tương đối ngay cả khi thư mục được thiết lập.

Vì vậy, sử dụng:

[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 

hơn:

[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 
Các vấn đề liên quan