Question

I run a small daemon and want it to be respawned when it is killed. I use "respawn" option in inittab on linux systems.(It is a small embedded platform.).

Now I am trying the same daemon on BSD. I have put my entry in "rc.d". But I could not find respawn option for BSD.

I can write a small program which respawns my daemon. But I was wondering if there must be something already built for BSD to restart killed services.

Do you know anything which I can use.

Thanks

P.S. I know I can do this thing in my daemon itself. But currently I dont have source for it.

Was it helpful?

Solution

The rc.d/init.d startup script convention does not provide for respawning daemons. That's one of the main reasons why alternatives like upstart and systemd have been created. On your embedded system, your best option is probably a small wrapper that monitors your daemon and restarts it when necessary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top