[Nut-upsuser] still no nut at reboot

Gene Heskett gene.heskett at gmail.com
Mon Nov 15 00:52:45 UTC 2010


On Sunday, November 14, 2010 07:01:48 pm Charles Lepple did opine:

> On Nov 13, 2010, at 1:58 PM, Gene Heskett wrote:
> > On Saturday, November 13, 2010 01:26:16 pm Charles Lepple did opine:
> >> On Nov 13, 2010, at 11:47 AM, Gene Heskett wrote:
> >>> That file is currently, and I believe pursuant to the install
> >>> instructions:
> >>> [root at coyote init.d]# ls -l /usr/local/ups/etc/ups.conf
> >>> -rw-r----- 1 root nut 95 2010-11-06 12:54 /usr/local/ups/etc/
> >>> ups.conf
> >>> 
> >>> What do I do to the perms etc so that this file is readable, both
> >>> now, and
> >>> during the bootup when I enable a link to it from /etc/rc5.d?
> >> 
> >> Does the mandriva script have the same assumptions about the NUT
> >> username? Also, is the "nut" user part of the "nut" group?
> > 
> > $NUTUSER in that script is 'gene'  aka me.  This is set by the scripts
> > parsing of /usr/local/ups/etc/upsmon.conf.  I have fixed a few other
> > problems in it by adding local vars for $DRIVERPATH and such.  It is
> > attached.  I have made some small progress with some of the other
> > errors
> > until I believe this is the final one.
> 
> I was going to try and install PCLinuxOS into a VM, but I haven't
> gotten very far with that. (It takes the VM about a half hour to boot
> to the login screen.)
> 
> However, poking around the script, the $NUTUSER variable seems to be
> referring to the "ups" user you created as part of the INSTALL file
> procedure. The upsmon.conf man page refers to another user ID (nut-
> mon) but that's a bit of extra paranoia that we can shelve for now.
> 
> > I also have not attempted as yet to port the corresponding upsmon
> > script,
> > nor do I have a working /etc/shutdown.  That was pointed out when I
> > walked
> > back in the house yesterday morning to discover that the slow beeps
> > were
> > from the ups as everything in here was running on it, so I did a
> > shutdown -
> > h now.  It was long enough that a similar ups in the shop also ran
> > out, but
> > no apparent damages otherwise except the proper rebooting of another
> > machine that doesn't have a ups on it.
> > 
> >> Also, is this the distribution you are using?
> >> http://www.pclinuxos.com/
> > 
> > Yes, all uptodate a/o last night except for tar-1.24 which breaks
> > amanda (I
> > think, I will retest tonight.  I play the canary for amanda as the
> > snapshots are released, have for years)
> > 
> > I printed the INSTALL file, and have now been through it from square
> > one,
> > checking things off as I go, restarting at step 6 at least a dozen
> > times
> > now, getting the no perms thing at step 8, 9 or 10.
> > 
> > From /etc/passwd:
> > [root at coyote Documents]# grep ups /etc/passwd
> > ups:x:479:415:system user for nut:/var/state/ups:/bin/false
> > izzat ^^^^^^ ?? I've done that by hand & may have it screwed up
> 
> The numerical UID and GID don't matter much, except that the GID needs
> to match between /etc/passwd and /etc/group (which it sounds like it
> does). You can also have strange behavior if you have two usernames
> which map to the same UID, but I don't think that would cause problems
> here.
> 
> > from /etc/group:
> > [root at coyote Documents]# grep nut /etc/group
> > nut:x:415:ups
> 
> That looks right.
> 
> I may have missed this answer, but are you testing by running "/etc/
> init.d/upsd restart", 

Yes;
[root at coyote ~]# /etc/init.d/upsd restart
nutuser=gene
nutuser=gene
NUT Stopping UPS daemon: Network UPS Tools upsd 2.4.3-2672
fopen /var/state/ups/upsd.pid: No such file or directory
                                                                                                                                                           [  
OK  ]
NUT Stopping UPS model drivers Network UPS Tools - UPS driver controller 
2.4.3-2672
Can't open /var/state/ups/usbhid-ups-auto.pid: No such file or directory
                                                                                                                                                           [FAILED]
nutuser=gene
NUT Starting UPS model drivers: Network UPS Tools - UPS driver controller 
2.4.3-2672
Network UPS Tools - Generic HID driver 0.35 (2.4.3-2672)
USB communication driver 0.31
Using subdriver: Belkin HID 0.12
                                                                                                                                                           [  
OK  ]
NUT Starting UPS daemon: Network UPS Tools upsd 2.4.3-2672
listening on localhost port 3493
listening on ::1 port 3493
/var/state/ups is world readable
Can't open /usr/local/ups/etc/ups.conf: Can't open 
/usr/local/ups/etc/ups.conf: Permission denied
                                                                                                                                                           [FAILED]
That was as root;
[root at coyote ~]# su - gene /etc/init.d/upsd restart
grep: /usr/local/ups/etc/upsmon.conf: Permission denied
grep: /usr/local/ups/etc/upsmon.conf: Permission denied
nutuser=ups
/etc/init.d/upsd: line 99: /etc/init.d/upsd: Permission denied
/etc/init.d/upsd: line 100: /etc/init.d/upsd: Permission denied
[root at coyote ~]# su - ups /etc/init.d/upsd restart
[root at coyote ~]# su - ups /etc/init.d/upsd restart
[root at coyote ~]# su - ups -c "/etc/init.d/upsd restart"
[root at coyote ~]#
> or just by rebooting? The former method should
> work, although I haven't poked around to verify if this is how
> PCLinuxOS works. (I'm a bit out of my element here, having only used
> Mandriva once several years back).

PClos is/was mandriva based, however it is now a 'rolling release', in 
other words always as uptodate as if it was a fresh release.  They 
occasionally rebuild the install iso's to match the current state, so there 
are now installation cd's available that are version'd newer, but are the 
same except for what I have installed extra, and even that stuff is also 
being updated.  Average number of packages updated per week probably 
exceeds 300.

[root at coyote ~]# zgrep RPM /var/log/messages.1.gz|wc -l
370
For last week alone.

You have an almost exact copy of that /etc/init.d/upsd script, except I 
added the echo that shows me the $nutuser you see above.

But, if I run the daemon itself as user ups:
[root at coyote ~]# su - ups -c "/usr/local/nut/bin/upsd"

no error returned, and I can then do this:
Except that I reset it all including nuking the user and group and started 
fresh, building it with the newer user and group.  But, in order to do 
that, I am going to see if I can fix /etc/udev/rules.d/52-nut-usbups.rules 
which spits out several screens full of errors because they have apparently 
changed the spelling of ATTR to ATTRS.  So I'm going to edit that and see 
about a reboot to get everything back on the same page.  I'll squawk if I 
can't get anywhere then.

Thanks Charles.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
A right is not what someone gives you; it's what no one can take from you.
		-- Ramsey Clark



More information about the Nut-upsuser mailing list