0

we want to know what are the options to control processes ,

for example

/opt/important_script/gate_machine.pl

is a script that must be up and running

and in case from some reason script killed , then we must to start it again

I was thinking to use some cron job under /etc/cron.d

and use it for this purpose ,

and every min check if PID is alive if not then cron job will start the script again

but I want to know about more options about this

  • 1
    If you're using a distro with systemd, just write a service file for your process, and have systemd manage it: medium.com/@benmorel/… – Martin von Wittich Mar 23 at 20:54
  • I was thinking that if we start the service and it fails then service will restart it , but what isn't clear that if for example I will kill the pid , the do you think the service will restart ? – yael Mar 23 at 21:06
  • 1
    Yes, if you specifiy Restart=always systemd would restart your service regardless of the reason for which it died. The only way to properly stop it would be systemctl stop <service>. – Martin von Wittich Mar 24 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.