Overnight the nginx web server crashed, and the site did not answer until morning. Repeat that crash on the training machine with two services, nginx and the cron scheduler, and compare what becomes of them.
The same failure
pkill -KILL -x <name> kills the processes with that name abruptly, which is what a program crash looks like. Kill the cron and nginx processes this way, ask the machine whether both services are running, and look at the summary for cron.
First, predict
What will systemctl is-active cron nginx print after the two identical crashes? The first line is about cron, the second about nginx.
Now start the exercise, run the command and compare your prediction with the output.
Why is cron running again after the same crash, while nginx is not?
-
It did: the
Activeline of the cron summary shows a start after your command, so a new process is running. -
It can be started; you will do that at the end of the lesson. It just did not come back by itself:
systemctl is-activeprintedfailedfor it. -
A process killed with KILL ends at once and can do nothing more. Some other program started the new cron process.
After the crash systemd started cron again and left nginx in the failed state.