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

fopen /run/nut/upsmon.pid: No such file or directory & nut-monitor.service: Supervising process 861 which is not our child. We'll most likely not notice when it exits. #2806

Open
Diktiorwalle opened this issue Feb 17, 2025 · 3 comments

Comments

@Diktiorwalle
Copy link

Dear Support,

Running: Linux Ubuntu 22.04
nut-client:
Package: nut-client
Version: 2.7.4-14ubuntu2

Running systemclt status nut-client show the following:

● nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2025-02-17 14:51:36 CET; 50s ago
Process: 816 ExecStart=/sbin/upsmon (code=exited, status=0/SUCCESS)
Main PID: 861 (upsmon)
Tasks: 2 (limit: 9086)
Memory: 4.1M
CPU: 16ms
CGroup: /system.slice/nut-monitor.service
├─858 /lib/nut/upsmon
└─861 /lib/nut/upsmon

Feb 17 14:51:35 systemd[1]: Starting Network UPS Tools - power device monitor and shutdown controller...
Feb 17 14:51:36 upsmon[816]: fopen /run/nut/upsmon.pid: No such file or directory
Feb 17 14:51:36 upsmon[816]: UPS: @ (slave) (power value 1)
Feb 17 14:51:36 upsmon[816]: Using power down flag file /etc/killpower
Feb 17 14:51:36 upsmon[858]: Startup successful
Feb 17 14:51:36 systemd[1]: nut-monitor.service: Can't open PID file /run/nut/upsmon.pid (yet?) after start: Operation not permitted
Feb 17 14:51:36 systemd[1]: nut-monitor.service: Supervising process 861 which is not our child. We'll most likely not notice when it exits.
Feb 17 14:51:36 systemd[1]: Started Network UPS Tools - power device monitor and shutdown controller.

Are those error messages or just information and the nut-client is working normally?:
fopen /run/nut/upsmon.pid: No such file or directory
nut-monitor.service: Can't open PID file /run/nut/upsmon.pid (yet?) after start: Operation not permitted
nut-monitor.service: Supervising process 861 which is not our child. We'll most likely not notice when it exits.

Kind Regards,

Rob

@jimklimov
Copy link
Member

For one, this should be mostly harmless. Several NUT daemons leave PID files so that later invocations for signal-sending (reload, etc.) know where to send them. With systemd, its reloader/restarter can be used instead.

Daemons also drop privileges (in case of upsmon, it also tries to save the new PID file after that); apparently /run/nut ownership/permission setting in that package (maybe via systemd-tmpfiles) is wrong - so the unprivileged program fails to write there (or maybe to replace the file it made earlier as root). No great loss, but any fixes should be asked via distro packaging.

Finally note that NUT v2.7.4 is about 9 years old. It was the newest release for too long, until 2022 (probably that's why it is still shipped in Ubuntu 22.04), but we've had several releases since then.

@Diktiorwalle
Copy link
Author

Thanks!

Yesterday I have updated the server to Ubuntu 24.04:
nut-client: 2.8.1-3.1ubuntu2

Running systemclt status nut-client show the following:

nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
Loaded: loaded (/usr/lib/systemd/system/nut-monitor.service; enabled; preset: enabled)
Active: active (running) since Tue 2025-02-18 10:30:10 CET; 3min 9s ago
Process: 21868 ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common-tmpfiles.conf (code=exited, status=1/FAILURE)
Main PID: 21869 (upsmon)
Tasks: 2 (limit: 9130)
Memory: 840.0K (peak: 1.1M)
CPU: 31ms
CGroup: /system.slice/nut-monitor.service
├─21869 /lib/nut/upsmon -F
└─21871 /lib/nut/upsmon -F

Feb 18 10:30:10 systemd[1]: Starting nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller...
Feb 18 10:30:10 systemd-tmpfiles[21868]: Failed to open '/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf': No such file or directory
Feb 18 10:30:10 systemd[1]: Started nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller.
Feb 18 10:30:10 nut-monitor[21869]: fopen /run/nut/upsmon.pid: No such file or directory
Feb 18 10:30:10 nut-monitor[21869]: Could not find PID file to see if previous upsmon instance is already running!
Feb 18 10:30:10 nut-monitor[21869]: UPS: @ (secondary) (power value 1)
Feb 18 10:30:10 nut-monitor[21869]: Using power down flag file /etc/killpower
Feb 18 10:30:10 nut-monitor[21871]: Init SSL without certificate database
Feb 18 10:30:10 nut-monitor[21871]: upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it

Following messages are shown: how can I solve those or are they are just informational?

Process: 21868 ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common-tmpfiles.conf
(code=exited, status=1/FAILURE)

Feb 18 10:30:10 systemd-tmpfiles[21868]: Failed to open '/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf': No such file or directory
Could not find PID file to see if previous upsmon instance is already running!

Failed to open '/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf: this file doesn't exists in this location.

running sudo upsc @:

Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: not set
battery.mfr.date: 2016/10/14
battery.runtime: 1702
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.6
battery.voltage.nominal: 12.0
device.mfr: APC
device.model: Back-UPS ES 700G
device.serial:
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 5
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: DSM7-2-1-69057-NM-nano-4-C1-240105
driver.version.data: APC HID 0.96
driver.version.internal: 0.41
input.sensitivity: medium
input.transfer.high: 266
input.transfer.low: 180
input.voltage: 238.0
input.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 871.O4 .I
ups.firmware.aux: O4
ups.load: 17
ups.mfr: APC
ups.mfr.date: 2016/10/14
ups.model: Back-UPS ES 700G
ups.productid: 0002
ups.serial:
ups.status: OL
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d

Kind Regards,

Rob

@jimklimov
Copy link
Member

Failed to open '/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf: this file doesn't exists in this location.

This seems significant, although here does not block the client from starting (may keep it unable to save the PID file). Probably the config file is placed into some other package by the distro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants