Exactly Jim,  this bothers me too much to give up :)

My upsmon.conf *does contain* line: POWERDOWNFLAG /etc/killpower

I checked for the existence of the file during shutdown with "/sbin/upsmon -K", 
and it exited with "1", meaning error: no POWERDOWNFLAG.


It is actually Truenas 25.04, with NUT 2.8.0. This may be Truenas issue, but I 
would like to check NUT first.

Now, for the logs: all I see about killpower is this line
     nut-monitor[2688]: Using power down flag file /etc/killpower
and it is logged when NUT service is starting. Thats all. No errors.


I attached log of the shutdown procedure. Truenas is configured to shutdown in 
60 seconds after power failure, and that is OK, but nothing about "killpower".


Now I wonder what creates POWERDOWNFLAG, and why it is not created.  I attached 
shutdown log, removed uneeded lines. Truenas is configured to wait 60 seconds 
and if power is not restored it shuts down.

Thanks,
Dario




On Monday, June 16, 2025 at 05:23:46 PM GMT+2, Jim Klimov 
<[email protected]> wrote: 


>Cheers,
>
>  Your test results seem encouraging, so giving up now sounds unfortunate - 
>perhaps just one more push is needed:
>
>* if `upsdrvctl shutdown` works, then at least basic driver settings in 
>ups.conf (and driver+device) do suffice for the action;
>* for a "killpower file", check that your upsmon.conf contains a line like
>
>POWERDOWNFLAG /etc/killpower
>
>** This line must be explicitly present (although a good path might be in a 
>tmpfs, like /run/nut/killpower instead).
>** Check upsmon logs - at least current NUT code should report if the value is 
>defined or not, and if it failed to create the file for example.
>
>* For the file to have effect, it should be consulted during OS shutdown. I 
>think you've never mentioned the OS nor NUT version, so details of this part 
>are highly variable. In a Linux system with systemd and NUT v2.8.x, you would 
>have a />usr/lib/systemd/system-shutdown/nutshutdown to call `upsdrvctl 
>shutdown` when deemed needed.
>
>Jim


On Mon, Jun 16, 2025, 14:11 Dario Novakovic via Nut-upsuser 
<[email protected]> wrote:
> Thanks Jim and Robert!
> 
> I confirmed that ups understands "turn off" request from the PC, with 
> "upsdrvctl shutdown".
> However, I am not sure if "killpower" file is created, when ups goes on 
> battery.
> 
> On the other hand I am not sure how CyberPower UPS interprets config params: 
> offdelay, ups.delay.shutdown, ups.timer.shutdown. I have been through so many 
> docs, forums, issue reports, etc.
> This is so confusing and messy, I am giving up. 
> 
> 
> Thanks all,
> Dario
> 
> 
> 
> 
> On Thursday, June 12, 2025 at 05:15:02 PM GMT+2, Dario Novakovic via 
> Nut-upsuser <[email protected]> wrote: 
> 
> I am using truenas with Cyber power CP900EPFCLCD UPS. All is well, server 
> shuts down after power loss in specified time.
> 
> Problem is that UPS remains ON. I would like UPS to turn OFF and I will turn 
> it on, when the power comes back. I tried many various configuration but it 
> does not affect the UPS.
> 
> Before I send all my config files and everything, I would like to understand 
> how it works. 
> 
> I have been messing with nut for days, setting various "delay"s, tried many 
> different settings and configs but I feel like I am missing something. I have 
> couple of general questions:
> 
> 1. Is it possible to turn the UPS off, after PC shut down.
> 2. If yes, how does it work? What makes UPS go off, when PC is off? What kind 
> of command or information is sent to UPS to make it turn off
> 3. What is the purpose of "ups.delay.shutdown". Documentation says "Interval 
> to wait after shutdown with delay command (seconds)". "Wait" for what exactly?
> 
> 
> Thanks,
> Dario
> 
> _______________________________________________
> Nut-upsuser mailing list
> [email protected]
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
> 
> _______________________________________________
> Nut-upsuser mailing list
> [email protected]
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
> 

Jun 16 18:56:30 truenas nut-monitor[405626]: UPS ups@localhost:3493 on battery
Jun 16 18:56:30 truenas nut-monitor[406162]: Executing command: NOTIFY-ONBATT
Jun 16 18:56:30 truenas upssched[406162]: Executing command: NOTIFY-ONBATT
Jun 16 18:56:31 truenas nut-monitor[406166]: null
Jun 16 18:56:31 truenas upssched[406192]: Timer daemon started
Jun 16 18:56:31 truenas upssched[406192]: New timer: SHUTDOWN (60 seconds)
Jun 16 18:56:31 truenas nut-monitor[406160]: Network UPS Tools upsmon 2.8.0
Jun 16 18:57:31 truenas upssched[406192]: Event: SHUTDOWN
Jun 16 18:57:31 truenas nut-monitor[405626]: Signal 10: User requested FSD
Jun 16 18:57:31 truenas nut-monitor[405626]: Executing automatic power-fail shutdown
Jun 16 18:57:31 truenas upsd[405569]: Client upsmon@::1 set FSD on UPS [ups]
Jun 16 18:57:31 truenas nut-server[405569]: Client upsmon@::1 set FSD on UPS [ups]
Jun 16 18:57:31 truenas nut-monitor[407476]: wall: /dev/ws/5: No such file or directory
Jun 16 18:57:31 truenas nut-monitor[405626]: Auto logout and shutdown proceeding
Jun 16 18:57:31 truenas nut-monitor[407479]: Executing command: NOTIFY-SHUTDOWN
Jun 16 18:57:31 truenas upssched[407479]: Executing command: NOTIFY-SHUTDOWN
Jun 16 18:57:31 truenas upssched[406192]: Timer queue empty, exiting
Jun 16 18:57:31 truenas nut-monitor[407484]: null
Jun 16 18:57:31 truenas nut-monitor[407477]: Network UPS Tools upsmon 2.8.0
Jun 16 18:57:36 truenas syslog-ng[2563]: syslog-ng shutting down; version='3.38.1'
Jun 16 18:57:36 truenas nut-monitor[405626]: Network UPS Tools upsmon 2.8.0
Jun 16 18:57:36 truenas nut-monitor[407594]: 735
Jun 16 18:57:36 truenas nut-monitor[405625]: Network UPS Tools upsmon 2.8.0
Jun 16 18:57:36 truenas systemd[1]: nut-monitor.service: Deactivated successfully.
Jun 16 18:57:36 truenas systemd[1]: nut-monitor.service: Consumed 1min 116ms CPU time.
Jun 16 18:57:36 truenas root[407659]: POWERDOWNFLAG NO            <------------------------------ this is what I logged with "upsmon -K"
Jun 16 18:57:36 truenas systemd[1]: ix-shutdown.service: Deactivated successfully.
Jun 16 18:57:36 truenas systemd[1]: Stopped ix-shutdown.service - Exec TrueNAS shutdown tasks.
Jun 16 18:57:36 truenas systemd[1]: Stopping middlewared.service - TrueNAS Middleware...
Jun 16 18:57:37 truenas nut-server[405569]: mainloop: Interrupted system call
Jun 16 18:57:37 truenas upsd[405569]: mainloop: Interrupted system call
Jun 16 18:57:37 truenas systemd[1]: Stopping nut-server.service - Network UPS Tools - power devices information server...
Jun 16 18:57:37 truenas nut-server[405569]: Signal 15: exiting
Jun 16 18:57:37 truenas nut-server[405569]: Network UPS Tools upsd 2.8.0
Jun 16 18:57:37 truenas upsd[405569]: Signal 15: exiting
Jun 16 18:57:37 truenas systemd[1]: Stopping smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon...
Jun 16 18:57:37 truenas smartd[2557]: smartd received signal 15: Terminated
Jun 16 18:57:37 truenas systemd[1]: nut-server.service: Deactivated successfully.
Jun 16 18:57:37 truenas smartd[2557]: Device: /dev/nvme0n1, state written to /var/lib/smartmontools/smartd.ADATA_SX8200PNP-2N032917SETA-n1.nvme.state
Jun 16 18:57:37 truenas systemd[1]: Stopped nut-server.service - Network UPS Tools - power devices information server.
Jun 16 18:57:37 truenas systemd[1]: Stopped target nut-driver.target - Network UPS Tools - target for power device drivers on this system.
Jun 16 18:57:37 truenas smartd[2557]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFPX_68C6CN0-WD_WX52DC488NJA.ata.state
Jun 16 18:57:37 truenas systemd[1]: Stopping [email protected] - Network UPS Tools - device driver for NUT device 'ups'...
Jun 16 18:57:37 truenas smartd[2557]: Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFPX_68C6CN0-WD_WX52DC48826A.ata.state
Jun 16 18:57:37 truenas smartd[2557]: smartd is exiting (exit status 0)
Jun 16 18:57:37 truenas systemd[1]: smartmontools.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon.
Jun 16 18:57:37 truenas nut-driver@ups[407694]: Network UPS Tools - UPS driver controller 2.8.0
Jun 16 18:57:37 truenas usbhid-ups[405568]: Signal 15: exiting
Jun 16 18:57:37 truenas systemd[1]: [email protected]: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped [email protected] - Network UPS Tools - device driver for NUT device 'ups'.
Jun 16 18:57:37 truenas systemd[1]: Removed slice system-nut\x2ddriver.slice - Slice /system/nut-driver.
Jun 16 18:57:37 truenas systemd[1]: system-nut\x2ddriver.slice: Consumed 6.415s CPU time.
Jun 16 18:57:37 truenas systemd[1]: wsdd.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped wsdd.service - Web Services Dynamic Discovery host daemon.
Jun 16 18:57:37 truenas systemd[1]: nfs-server.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped nfs-server.service - NFS server and services.
Jun 16 18:57:37 truenas systemd[1]: Stopping gssproxy.service - GSSAPI Proxy Daemon...
Jun 16 18:57:37 truenas rpc.idmapd[2427]: exiting on signal 15
Jun 16 18:57:37 truenas systemd[1]: systemd-sysctl.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped systemd-sysctl.service - Apply Kernel Variables.
Jun 16 18:57:37 truenas systemd[1]: systemd-coredump.socket: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Closed systemd-coredump.socket - Process Core Dump Socket.
Jun 16 18:57:37 truenas systemd[1]: systemd-modules-load.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped systemd-modules-load.service - Load Kernel Modules.
Jun 16 18:57:37 truenas systemd[1]: run-credentials-systemd\x2dsysctl.service.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted run-credentials-systemd\x2dsysctl.service.mount - /run/credentials/systemd-sysctl.service.
Jun 16 18:57:37 truenas auditd[2429]: The audit daemon is exiting.
Jun 16 18:57:37 truenas systemd[1]: auditd.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped auditd.service - Security Auditing Service.
Jun 16 18:57:37 truenas kernel: kauditd_printk_skb: 7 callbacks suppressed
Jun 16 18:57:37 truenas kernel: audit: type=1305 audit(1750093057.816:224): op=set audit_pid=0 old=2429 auid=4294967295 ses=4294967295 subj=unconfined res=1
Jun 16 18:57:37 truenas systemd[1]: systemd-tmpfiles-setup.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Stopped systemd-tmpfiles-setup.service - Create System Files and Directories.
Jun 16 18:57:37 truenas systemd[1]: Stopped target local-fs.target - Local File Systems.
Jun 16 18:57:37 truenas systemd[1]: Unmounting audit.mount - /audit...
Jun 16 18:57:37 truenas systemd[1]: Unmounting boot-grub.mount - /boot/grub...
Jun 16 18:57:37 truenas systemd[1]: Unmounting conf.mount - /conf...
Jun 16 18:57:37 truenas systemd[1]: Unmounting data.mount - /data...
Jun 16 18:57:37 truenas systemd[1]: Unmounting home.mount...
Jun 16 18:57:37 truenas kernel: audit: type=1305 audit(1750093057.828:225): op=remove_rule dir="/data/" key="escalation" list=4 res=1
Jun 16 18:57:37 truenas systemd[1]: Unmounting opt.mount - /opt...
Jun 16 18:57:37 truenas systemd[1]: Unmounting root.mount - /root...
Jun 16 18:57:37 truenas systemd[1]: Unmounting tmp.mount - Temporary Directory (/tmp)...
Jun 16 18:57:37 truenas umount[407729]: umount: /run/credentials/systemd-tmpfiles-setup.service: no mount point specified.
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-db-system-configs\x2dae32c386e13840b2bf9c0083275e7941.mount - /var/db/system/configs-ae32c386e13840b2bf9c0083275e7941...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-db-system-cores.mount - /var/db/system/cores...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-db-system-netdata.mount - /var/db/system/netdata...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-db-system-nfs.mount - /var/db/system/nfs...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-db-system-samba4.mount - /var/db/system/samba4...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-lib-incus.mount...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-lib-systemd-coredump.mount - /var/lib/systemd/coredump...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-local-ca\x2dcertificates.mount - /var/local/ca-certificates...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-log-journal.mount...
Jun 16 18:57:37 truenas systemd[1]: Unmounting var-log.mount...
Jun 16 18:57:37 truenas umount[407741]: umount: /var/log/journal: target is busy.
Jun 16 18:57:37 truenas umount[407742]: umount: /var/log: target is busy.
Jun 16 18:57:37 truenas systemd[1]: tnaudit.service: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: audit.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted audit.mount - /audit.
Jun 16 18:57:37 truenas systemd[1]: boot-grub.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted boot-grub.mount - /boot/grub.
Jun 16 18:57:37 truenas systemd[1]: conf.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted conf.mount - /conf.
Jun 16 18:57:37 truenas systemd[1]: data.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted data.mount - /data.
Jun 16 18:57:37 truenas systemd[1]: home.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted home.mount.
Jun 16 18:57:37 truenas systemd[1]: opt.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted opt.mount - /opt.
Jun 16 18:57:37 truenas systemd[1]: root.mount: Deactivated successfully.
Jun 16 18:57:37 truenas systemd[1]: Unmounted root.mount - /root.
Jun 16 18:57:37 truenas systemd[1]: Unmounted tmp.mount - Temporary Directory (/tmp).
Jun 16 18:57:38 truenas umount[407750]: umount: /var: target is busy.
Jun 16 18:57:38 truenas systemd[1]: var.mount: Mount process exited, code=exited, status=32/n/a
Jun 16 18:57:38 truenas systemd[1]: Failed unmounting var.mount.
Jun 16 18:57:38 truenas systemd[1]: mnt.mount: Deactivated successfully.
Jun 16 18:57:38 truenas systemd[1]: Unmounted mnt.mount.
Jun 16 18:57:38 truenas systemd[1]: Stopped target local-fs-pre.target - Preparation for Local File Systems.
Jun 16 18:57:38 truenas systemd[1]: Reached target umount.target - Unmount All Filesystems.
Jun 16 18:57:38 truenas systemd[1]: systemd-tmpfiles-setup-dev.service: Deactivated successfully.
Jun 16 18:57:38 truenas systemd[1]: Stopped systemd-tmpfiles-setup-dev.service - Create Static Device Nodes in /dev.
Jun 16 18:57:38 truenas systemd[1]: systemd-sysusers.service: Deactivated successfully.
Jun 16 18:57:38 truenas systemd[1]: Stopped systemd-sysusers.service - Create System Users.
Jun 16 18:57:38 truenas systemd[1]: systemd-remount-fs.service: Deactivated successfully.
Jun 16 18:57:38 truenas systemd[1]: Stopped systemd-remount-fs.service - Remount Root and Kernel File Systems.
Jun 16 18:57:38 truenas systemd[1]: Reached target shutdown.target - System Shutdown.
Jun 16 18:57:38 truenas systemd[1]: Reached target final.target - Late Shutdown Services.
Jun 16 18:57:38 truenas systemd[1]: systemd-poweroff.service: Deactivated successfully.
Jun 16 18:57:38 truenas systemd[1]: Finished systemd-poweroff.service - System Power Off.
Jun 16 18:57:38 truenas systemd[1]: Reached target poweroff.target - System Power Off.
Jun 16 18:57:38 truenas systemd[1]: Shutting down.
Jun 16 18:57:38 truenas systemd-shutdown: Syncing filesystems and block devices.
Jun 16 18:57:43 truenas systemd-shutdown: Sending SIGTERM to remaining processes...
Jun 16 18:57:43 truenas systemd-journald[651]: Received SIGTERM from PID 1 (systemd-shutdow).
Jun 16 18:57:43 truenas systemd-journald[651]: Journal stopped
_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to