We are using centos. As soon as the server is restarted and the OS is fully loaded, we would like to have a certain user ("foo") start three or four scripts with screen.
screen -d -m -S script1 forever -o script1.log -e script1.log -l script1.log -c php /path/to/script1.php
What's the best way to achieve this using CentOS? I would prefer to avoid having to dig into init.d too much.
Using systemd, I try to inspect the service ("notify") and see this:
Loaded: loaded (/etc/systemd/system/notify@.service; enabled) Active: failed (Result: exit-code) since Sun 2016-03-20 15:08:04 EDT; 14s ago Process: 1690 ExecStop=/usr/bin/screen -S notify -X quit (code=exited, status=1/FAILURE) Process: 941 ExecStart=/usr/bin/screen -d -m -S notify forever -o notifyout.log -e notifyerr.log -l notifyforever.log -c php /path/to/script/notify.php (code=exited, status=0/SUCCESS) Main PID: 946 (code=exited, status=0/SUCCESS)
Why is it getting stopped? How can I begin to debug this?