Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upsd.pid/upsmon.pid are important for live config reload (systemd might do without it?) #1299

Open
jimklimov opened this issue Feb 16, 2022 · 3 comments
Labels
service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug systemd

Comments

@jimklimov
Copy link
Member

jimklimov commented Feb 16, 2022

Currently our daemons allow to run their binary in a way that they send a signal to earlier launched copy of the process, using the saved PID file, and so tell it to reload configuration.

With recent changes aimed at avoiding daemon backgrounding (particularly in systemd wraps), we are losing reasons to keep up the PID file manipulation in certain usage scenarios. Need to investigate redefining systemd unit "ExecReload" lines:

  • is there equivalent signal-sending right away?
  • can we use the $MAINPID (IIRC the name) and extend the daemon CLI args in a way that we would tell the program which process it should communicate with (same data it would get from a PID file, but without a file)

See also #123

@jimklimov jimklimov added systemd service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug labels Feb 16, 2022
jimklimov added a commit to jimklimov/nut that referenced this issue Feb 16, 2022
jimklimov added a commit to jimklimov/nut that referenced this issue Feb 16, 2022
jimklimov added a commit to jimklimov/nut that referenced this issue Feb 16, 2022
jimklimov added a commit to jimklimov/nut that referenced this issue Feb 16, 2022
@ebenostby
Copy link

Apologies for hijacking this thread with a question - though in upsd you can override directory for pid files, AFAIK with upsmon it's hardwired to PIDPATH (/var/run) and can't be overridden at runtime. It could be changed at build time.
To prevent problems with cruft left in the pidfile I've symlinked /var/run to /tmp so it gets cleaned at reboot. My question is: should this be configurable for upsmon? Shouldn't it be in /tmp?
Thanks for your thoughts.

@jimklimov
Copy link
Member Author

jimklimov commented Apr 1, 2022 via email

@ebenostby
Copy link

Good advice. Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug systemd
Projects
None yet
Development

No branches or pull requests

2 participants