Message ID | 20201217093537.22653-3-fe@dev.tdt.de |
---|---|
State | New |
Delegated to: | Daniel Golle |
Headers | show |
Series | ubus: extend the service object with a restart method | expand |
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index f39b69464e..ad5af4b7a1 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -139,6 +139,19 @@ extra_command "enabled" "Check if service is started on boot" fi } + restart() { + if eval "type restart_service" 2>/dev/null >/dev/null; then + restart_service "$@" + else + trap '' TERM + stop "$@" + trap - TERM + start "$@" + fi + procd_open_service "$(basename ${basescript:-$initscript})" "$initscript" + procd_close_service "restart" + } + trace() { TRACE_SYSCALLS=1 start "$@"
Thies commit add the new wrapper function to rc.common to execute the new ubus service method "restart" on a service restart. Signed-off-by: Florian Eckert <fe@dev.tdt.de> --- package/base-files/files/etc/rc.common | 13 +++++++++++++ 1 file changed, 13 insertions(+)