<div dir="ltr"><div>For the sake of cross-referencing, posted an issue at <a href="https://github.com/networkupstools/nut/issues/1727">https://github.com/networkupstools/nut/issues/1727</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 1, 2022 at 7:44 PM Jim Klimov <<a href="mailto:jimklimov%2Bnut@gmail.com">jimklimov+nut@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Curious finding up there. I think this is due to `<span>load_upsdconf</span>(<span>0</span>);` being at <a href="https://github.com/networkupstools/nut/blob/master/server/upsd.c#L1776" target="_blank">https://github.com/networkupstools/nut/blob/master/server/upsd.c#L1776</a> 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).</div><div><br></div><div>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.<br></div><div><br></div><div>So it is messed up somewhat.</div><div><br></div><div>FWIW, last week I tried to track down current usage of various PATHs in the sources, see <a href="https://github.com/networkupstools/nut/issues/1712#issuecomment-1327627850" target="_blank">https://github.com/networkupstools/nut/issues/1712#issuecomment-1327627850</a> if interested :)</div><div><br></div><div>Hope this helps,<br></div><div>Jim Klimov<br></div></div><br>
</blockquote></div></div>