Solved nut_enable="YES" but nut ain't starting on reboot

I am sure I will feel dumb when I see the solution, but this doesn't make sense at the moment!

I have Network UPS Tools installed, and everything works fine if I do:

/usr/local/etc/rc.d/nut start

And, my /etc/rc.conf contains the lines that should enable nut:

Code:
nut_enable="YES"
nut_upslog_enable="YES"
nut_upsmon_enable="YES"

nut.conf contains:

Code:
MODE=standalone

But, when I restart the system, nut does not fire up. I have to start it manually.

What am I missing?
 
Look in the file for nut in /usr/local/etc/rc.d/, next to rcvar to find the correct argument to turn it on.
 
Try setting rc_debug="YES" in /etc/rc.conf to get really verbose output from rc scripts, which could provide some hints on why it's not starting on boot.
 
Look in the file for nut in /usr/local/etc/rc.d/, next to rcvar to find the correct argument to turn it on.

It shows:

Code:
rcvar=nut_enable

And I do have nut_enable="YES" in rc.conf. You see my confusion. :)

Try setting rc_debug="YES" in /etc/rc.conf to get really verbose output from rc scripts, which could provide some hints on why it's not starting on boot.

I didn't know about that one! I'll try that tonight.

Thanks everyone.
 
Also do a search for nut in /var/log/messages to see if there are any errors being emitted.

Good idea; just took a peek and nothing relevant shows up when searching for nut or ups (case insensitive).

Tonight I will try rc_debug="YES" and hope for a clue in the verbose output.
 
OK, the relevant lines from messages are below, with rc_debug turned on.

Everything looks OK except for the Access Denied message, but here's the weird thing... nut started correctly on this boot and I can probe the UPS fine. So, there was apparently nothing wrong with my configuration. The only thing that changed was turning on rc_debug!

Perhaps there is a timing issue, and debug logging changed timing enough for things to work this time? Weird. Anyway, thanks for the help, I still learned a new rc.conf trick!

Code:
Oct  3 09:34:17 hostname root: /etc/rc: DEBUG: run_rc_command: doit:  limits -C daemon /usr/local/sbin/upsd
Oct  3 09:34:17 hostname root: /etc/rc: DEBUG: found ruleset: nut_usb=10
Oct  3 09:34:17 hostname root: /etc/rc: DEBUG: checkyesno: nut_enable is set to YES.
Oct  3 09:34:17 hostname root: /etc/rc: DEBUG: run_rc_command: start_precmd: nut_prestart
Oct  3 09:34:17 hostname upsd[1103]: /usr/local/etc/nut/upsd.conf is world readable
Oct  3 09:34:17 hostname upsd[1103]: /usr/local/etc/nut/upsd.users is world readable
Oct  3 09:34:17 hostname root: /etc/rc: DEBUG: checkyesno: nut_upsmon_enable is set to YES.
Oct  3 09:34:17 hostname root: /etc/rc: DEBUG: run_rc_command: doit:  limits -C daemon /usr/local/sbin/upsmon localhost
Oct  3 09:34:17 hostname root: /etc/rc: DEBUG: checkyesno: nut_upslog_enable is set to YES.
Oct  3 09:34:17 hostname upsmon[1111]: Login on UPS [ups@localhost] failed - got [ERR ACCESS-DENIED]
 
Back
Top