根據我需要創建以下文件如下:如何爲多個應用程序部署web2py調度程序?
/etc/init/web2py-scheduler.conf
的web2py-scheduler.conf
description "web2py task scheduler"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.
exec sudo -u <user> python /home/<user>/web2py/web2py.py -K <myapp>
respawn
問題
做什麼,我如果我想爲2個應用程序安排一個調度程序嗎?
我應該創建兩個.conf
文件還是創建1個文件,其中包含兩個exec command
實例?
有兩個文件的解決辦法是:
/etc/init/web2py-scheduler.app1.conf:
description "web2py task scheduler App1"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.
exec sudo -u <user> python /home/<user>/web2py/web2py.py -K App1
respawn
的/ etc /初始化/的web2py -scheduler.app2.conf:
description "web2py task scheduler App2"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.
exec sudo -u <user> python /home/<user>/web2py/web2py.py -K App2
respawn
一個文件解決方案:
/etc/init/web2py-scheduler.conf:
description "web2py task scheduler"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.
exec sudo -u <user> python /home/<user>/web2py/web2py.py -K App1
exec sudo -u <user> python /home/<user>/web2py/web2py.py -K App2
respawn
對不起,如果這是顯而易見的,但我有書面的conf沒有經驗文件以及系統的這部分如何工作。
謝謝