E
E
Egor Sviridov2021-06-16 17:24:45
linux
Egor Sviridov, 2021-06-16 17:24:45

How to make it so that after the abnormal termination of the process - this process will start again?

I'm making a server by lane and it would not hurt me to learn how to restart the process if it crashed. I used cron to start the server when the machine starts. Every day it completes the process and starts again at a certain time. Also, the file that starts the server also starts the screen ts session in order to see what is happening on the server. Is it possible to do this: if a certain session disappears, does the command to run this file run again?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-06-16
@ai_zen_berg

You write a daemon
In Linux, systemd is now in charge of daemons, so create a unit that restarts on error
Start here https://m.habr.com/ru/company/southbridge/blog/255845/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question