Procd : adding something like sd_notify watchdog?

I'm working on a new application for an OpenWRT device.

One of the features that I wish I had access to in OpenWRT is the ability to have procd terminate and restart a service, if that service fails to send procd an "I'm alive" message via a Unix Domain Socket periodically.

I've used this with applications on a desktop / server setting in the past, where systemd allows a service to be configured such that if the service failed to call sd_notify periodically (which, under the hood, just sends a message to a Unix Domain Socket), the service would be terminated and re-started.

This is great for network servers, to ensure that a programming bug hasn't caused the server to hang indefinitely.

I don't see any indication that this kind of functionality is supported by procd.

Is this functionality available?

If not, are there any patches that implement it?

If not, would OpenWRT accept a patch that implemented this feature?

Well this can be implemented in the application by using uloop or ubus

There is no indication of that anywhere on the OpenWRT development documentation. (Or the parts of the source code I read through)

Can you please elaborate?

uloop is part of the ubox library (if i remember correctly) It can be used to create a service that does operation every n second

Yes. Uloop is part of ubox. Ubox is a relatively tiny collection of c library functions.

I imagine that if procd ever supported a feature like SD_notify from systemd, it would be implemented using ubus like most other openwrt features.

That being said, ubus is simply Unix domain sockets under the hood, so while I appreciate the attempt at helping, I was really hoping for a more definitive answer on whether functionality like this exists, or is planned.




Thank you!