upsd uses PID files before looking at upsd.conf and before chrooting #1727
Labels
bug
service/daemon start/stop
General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug
Milestone
https://alioth-lists.debian.net/pipermail/nut-upsuser/2022-December/013026.html
Curious finding up there. I think this is due to
load_upsdconf(0);
being at https://github.com/networkupstools/nut/blob/master/server/upsd.c#L1776 -- so being after the initial signal-probing for competitors (or sending a command to a running daemon), so using built-in PID/STATE paths, and notably that probing happens before the optional chrooting (and PID file is later recorded relative to the chroot).For that initial probing, it would honor the NUT_ALTPIDPATH envvar (although still disregarding "relative to chroot" part if used), but not yet the know config file contents.
So it is messed up somewhat.
FWIW, last week I tried to track down current usage of various PATHs in the sources, see #1712 (comment) if interested :)
CC @aquette @clepple : is this a low-hanging fruit (to smartly reshuffle a few lines), or do I miss something in the bigger picture and historic considerations?
The text was updated successfully, but these errors were encountered: