I'm trying to have a System V service relaunched on exit.

EDIT: Should have precised that I'm using busybox init system instead of classic systemV

I found that It could be done using /etc/inittab with the keyword respawn as action (man inittab).

The process will be restarted whenever it terminates (e.g. getty).

This seems to be the right action to set, however with respawn the service will be launched at boot.

I would like to have this service restarted but only after it has been launched from command line.

Is this possible to configure the service to respawn but not to be launched at boot ?

  • Not that I can think of. init typically knows when to restart it because it started it to begin with and gets a signal when it terminates. I don't know of a way to have it monitor some "other" process. – Andy Dalton Jun 25 '18 at 16:57
  • The respawn in inittab will always run it on boot. I don't think that solution is going to yield the results you want. I'd take a look at possibly doing something with supervisord or GOD. – slm Jun 25 '18 at 22:47

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.