nut: Fix nutmon issues with init
authorDaniel F. Dickinson <redacted>
Sun, 28 Apr 2019 20:08:45 +0000 (20:08 +0000)
committerDaniel F. Dickinson <redacted>
Sun, 28 Apr 2019 20:17:12 +0000 (20:17 +0000)
commit867ea959a216046a267e832ac07f8fcab99362f0
treeb6258041e2a549b99eaf07ea82c5e73f6fe28aeb
parentbd061e154d3cb1b6018b69152ebb0f8d253da98f
nut: Fix nutmon issues with init

NUT's upsmon is rather peculiar in that it has a child process that runs as
a regular user and a parent process that runs as root (in order to facilitate
shutting down the device if needed).  procd doesn't deal well with this and
doing 'normal' procd stop / restart / etc results in the child process still
hanging around but with not parent, which causes undesired behaviour.  Therefore,
add the use of 'upsmon -c stop' during process shutdown / restart in order to
ensure that upsmon is actually fully stopped.

Also fixes nut-monitor going into crashloop on network changes (due to
trigger that restarted upsmon but failed due to orphan child from before
restart).

Signed-off-by: Daniel F. Dickinson <redacted>
net/nut/files/nut-monitor.init
git clone https://git.99rst.org/PROJECT