根据我需要创建以下文件如下:如何为多个应用程序部署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没有经验文件以及系统的这部分如何工作。
谢谢