According to the following I need to create the following file:
/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
The Question
What do I do if I want to have a scheduler for 2 apps?
Should I create two .conf
files or create 1 file with 2 instances of the exec command
?
The solution with two files would be:
/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/init/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
The solution with one file:
/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
sorry if this is obvious but I have no experience in writing conf files and how this part of the system works.
thank you