linux - how to protect my process from being killed? -
we have mission-critical server program on top of linux , dont't want others terminate accidentally. if terminates or crashes, want restart.
so plan write program, program b. want program b , server program protect each other. if our server program exits, program b restart it. if program b terminates, server program start again. don't have mechanism let program b , server program notified when peer exits.
you can use init babysit process, , since init terminates on reboot, don't need "program b".
add end of /etc/inittab:
x:3:respawn:/path/to/my/program
for information on syntax , other options can found in man inittab
Comments
Post a Comment