sysupgrade success detection from scripts
Jonas Lochmann
openwrt at jonaslochmann.de
Fri Nov 20 23:02:59 PST 2026
I am developing a tool to run sysupgrade when the network load
is low/there is a good chance no one notices a small downtime.
I tried to detect the success by checking the exit code of
sysupgrade. In case of failure, I am deleting the upgrade
file. This turned out to not work, because sysupgrade does not
return zero and thus the file was deleted before the actual
upgrade started so that a reboot without upgrade occured.
My workaround now consists of checking if the "system" service
is reachable before and after calling sysupgrade [1]. This
service is provided by procd and is replaced by upgraded on
success and thus becomes unreachable.
Does anyone know a better way to check the sysupgrade success?
[1] https://codeberg.org/boringrouter/boringrouter/src/branch/2026-11-04/feeds/packages/admin/background-update/files/usr/sbin/backgroundupdated#L130
More information about the openwrt-devel
mailing list