/usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut
root@firewall:/var/db # /usr/local/etc/rc.d/nut restartnut not running? (check /var/db/nut/upsd.pid).Network UPS Tools - UPS driver controller 2.8.0Network UPS Tools - Generic HID driver 0.47 (2.8.0)USB communication driver (libusb 1.0) 0.43Can't chdir to /var/db/nut: Permission deniedDriver failed to start (exit status=1)/usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nutroot@firewall:/var/db #
root@firewall:/var/db # ls -la nut/total 12drwxr-x--- 2 uucp uucp 512 Jan 26 17:53 .drwxr-xr-x 24 root wheel 1024 Jan 26 17:52 ..-rw-r--r-- 1 root uucp 6 Jan 26 17:53 upsmon.pidroot@firewall:/var/db #
root@*******:/var/log # ls -al /var/db/nut/total 20drwxrwxrwx 2 uucp uucp 512 Jan 26 18:41 .drwxr-xr-x 21 root wheel 1536 Jan 26 18:37 ..-rw-r--r-- 1 nut uucp 6 Jan 26 18:41 upsd.pid-rw-r--r-- 1 root uucp 6 Jan 26 18:38 upsmon.pidsrw-rw---- 1 nut uucp 0 Jan 26 18:41 usbhid-ups-DP-rw-r--r-- 1 nut uucp 6 Jan 26 18:41 usbhid-ups-DP.pid
/usr/local/opnsense/scripts/OPNsense/Nut/setup.sh
root@********:/usr/local/opnsense # more scripts/OPNsense/Nut/setup.sh#!/bin/shmkdir -p /var/db/nutchown uucp:uucp /var/db/nut
The right fix is likely that the owner:group of /var/db/nut remains nut:nut so that everything works. Unsure why this becomes uucp:uucp at some point.Changing the permissions to 777 on /var/db/nut makes things work (DP is the UPS name)Code: [Select]root@*******:/var/log # ls -al /var/db/nut/total 20drwxrwxrwx 2 uucp uucp 512 Jan 26 18:41 .drwxr-xr-x 21 root wheel 1536 Jan 26 18:37 ..-rw-r--r-- 1 nut uucp 6 Jan 26 18:41 upsd.pid-rw-r--r-- 1 root uucp 6 Jan 26 18:38 upsmon.pidsrw-rw---- 1 nut uucp 0 Jan 26 18:41 usbhid-ups-DP-rw-r--r-- 1 nut uucp 6 Jan 26 18:41 usbhid-ups-DP.pidThis is definitely not a good fix in any way, it is very bad and insecure but it gets me going for now until the right solution is found or this is fixed.
Does this do the job? https://github.com/opnsense/plugins/commit/16cbe99ebf# opnsense-patch -c plugins 16cbe99ebf