If a process is killed with sigkill, how do I get it to work again?

I have a process that other processes are trying to kill, and if they succeed, how can I make sure that the process starts again?

+3
source share
5 answers

Check inittab . Look for respawn :)

The process will restart when it finishes.

Here is an example from my own inittab:

c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux

c1- this is id (must be unique), 2,3,4,5- these are the runlevels to which this applies, respawn states what I said earlier, and the rest is a command. There you can simply add your team and it should work well.

+4
source

inittab, , - inittab, . , inittab respawning , , . , .

, . . , , .

, .

Monit. , , . -, , . .

+3

. , , . SIGTERM, kill. kill -sigkill ( kill -9, ) ; , ( , , , , , , , ..).

, SIGKILL, .

+2
source

Some versions of Linux (e.g. Ubuntu) prefer /etc/event.d over inittab. This is a similar concept, but a different implementation.

+2
source

You could always pull the Robin Hood / Brother Tuk thing, but these days you can kill both processes at the same time.

-1
source

Source: https://habr.com/ru/post/1746568/


All Articles