[OpenWrt-Devel] Ubus based service watchdog?

Eric Romano gelstudios at gmail.com
Wed May 13 14:53:08 EDT 2020

It does seem like process supervision would be a nice capability to
have within procd.

Previously I've done this by a combination of:
1. trying to crash / exit the process when an inconsistent state is hit.
2. monitoring for delayed writes to a timestamp pidfile in temp.

procd's respawn directive can handle the first case (i forget but
something like "respawn 10 5 0" did fine), but the second one...
depended on a clumsy nanny process to reap / kill any that failed to
update their timestamp.

Feature wise, it would be nice to have more than one way to perform
the process health check.

Some options that come to mind are:
- a ping / pong -like method via ubus
- expecting the process to "touch" a specified file, which procd could
read stat times for
- either of the above, with the ability to trigger a refresh via
signal like SIGUSR1 or SIGUSR2, etc.

Would be good to hear what other methods have been tried by others,
and what a generic interface to this could look like in procd's

On Wed, May 13, 2020 at 1:49 PM Michael Jones <mike at meshplusplus.com> wrote:
> I have a critical service on my OpenWRT system that needs monitoring and re-starting if it's failed.
> I've been looking for a mechanism in procd that would allow me to request that my service be terminated if it did not periodically notify some watchdog endpoint via ubus.
> It seems to me like this is not something that is currently supported by procd, and I've written my own clumsy "watchdog" wrapper program that tries to do the job.
> Are there any plans to support a feature like this in procd directly in the future?
> If there are no plans, and I were to write code for this, would OpenWRT be interested in reviewing, and then merging, patches?
> Are there other people on this list who would take advantage of this feature if it were available? If so, what functionality would you like to see?
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list