Init.d restart service on failure

Hi

If I have a custom service in /etc/init.d and 'enabled' (ie symlinked) to rc.d, is there any way I can make that service automatically restart if it fails?

I looked at the openWrt articles here and here but I didn't see anything about restart-on-failure.

On previous systems I used systemctrl which has a "restart" option in the service file.

So is there a way to have a service restarted if it fails?

1 Like

https://openwrt.org/docs/guide-developer/procd-init-scripts?s=procd_set_param%20respawn

4 Likes

Thanks! Exactly what I was looking for.

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.