diff --git a/net/nut/files/nut-monitor.init b/net/nut/files/nut-monitor.init index bc463d7f5..e57a2870b 100755 --- a/net/nut/files/nut-monitor.init +++ b/net/nut/files/nut-monitor.init @@ -148,7 +148,6 @@ nut_upsmon_add() { } build_config() { - local runas=nutmon mkdir -m 0750 -p "$(dirname "$UPSMON_C")" config_load nut_monitor @@ -193,6 +192,7 @@ interface_triggers() { } start_service() { + local runas=nutmon local havemon havems build_config @@ -210,16 +210,9 @@ start_service() { return 0 } -restart() { - trap '' TERM - stop "$@" - sleep 2 - trap - TERM - start "$@" -} - reload_service() { if pgrep upsmon >/dev/null 2>/dev/null; then + local runas=nutmon build_config /usr/sbin/upsmon -c reload else @@ -227,6 +220,10 @@ reload_service() { fi } +stop_service() { + upsmon -c stop +} + service_triggers() { config_load nut_monitor interface_triggers "add_trigger"