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

horseflesh

Member

Thanks: 4
Messages: 69

#1
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?
 

sidetone

Aspiring Daemon

Thanks: 319
Messages: 926

#2
Look in the file for nut in /usr/local/etc/rc.d/, next to rcvar to find the correct argument to turn it on.
 

yuripv

Member

Thanks: 14
Messages: 36

#3
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.
 
OP
OP
horseflesh

horseflesh

Member

Thanks: 4
Messages: 69

#4
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.
 

phoenix

Administrator
Staff member
Administrator
Moderator

Thanks: 1,166
Messages: 3,993

#5
Also do a search for nut in /var/log/messages to see if there are any errors being emitted.
 
OP
OP
horseflesh

horseflesh

Member

Thanks: 4
Messages: 69

#6
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.
 
OP
OP
horseflesh

horseflesh

Member

Thanks: 4
Messages: 69

#7
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]
 
Top