diff options
author | John Crispin <john@phrozen.org> | 2021-11-12 19:59:29 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-11-23 13:56:47 +0000 |
commit | 87b583635475c56ae5b8ec89233f6f292ba09765 (patch) | |
tree | e6eca305ab9a8533104c1332339e282529b04a0d /system.c | |
parent | bf3fe0e8c02ff13171ea9f2a79703abc099105bf (diff) | |
download | procd-87b583635475c56ae5b8ec89233f6f292ba09765.tar.gz |
procd: add full service shutdown prior to sysupgrade
Currently OpenWrt will use the kill loop in stage2 to stop tasks. This can
fail as seen with wpa_supplicant not properly shutting down with certain
mesh configurations. Trigger the existing service_stop() code path for all
services just before exec'ing to upgraded.
Signed-off-by: John Crispin <john@phrozen.org>
[make use of *_safe function now introduced for that purpose, also stop
container instances]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'system.c')
-rw-r--r-- | system.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -33,6 +33,7 @@ #include "procd.h" #include "sysupgrade.h" #include "watchdog.h" +#include "service/service.h" static struct blob_buf b; static int notify; @@ -810,6 +811,8 @@ static int sysupgrade(struct ubus_context *ctx, struct ubus_object *obj, return UBUS_STATUS_NOT_SUPPORTED; } + service_stop_all(); + sysupgrade_exec_upgraded(blobmsg_get_string(tb[SYSUPGRADE_PREFIX]), blobmsg_get_string(tb[SYSUPGRADE_PATH]), tb[SYSUPGRADE_BACKUP] ? blobmsg_get_string(tb[SYSUPGRADE_BACKUP]) : NULL, |