简体   繁体   中英

respawn option for bsd rc.d

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM