[Nut-upsuser] infosec e4

Charles Lepple clepple at gmail.com
Thu Aug 1 12:25:55 UTC 2013


On Jul 31, 2013, at 9:07 AM, James HORLEY wrote:

> I’m wondering if what I have done is good :
>     # get the source from github on my computer
>     # autogen.sh
>     # name=nut
>     # ./configure --prefix=/ --sysconfdir=/etc/$name --mandir=/usr/share/man 
> --libdir=/usr/lib --includedir=/usr/include --datadir=/usr/share/$name 
> --with-statepath=/var/run/nut --with-altpidpath=/var/run/nut 
> --with-drvpath=/lib/nut --with-pidpath=/var/run/$name 
> --with-user=$name –with-group=$name --without-ssl
 
If these are the same parameters as are used to build the .deb, then that should owrk.

> There was an error :
>     ./configure: line 7079: syntax error near unexpected token `CPPUNIT,'
>     ./configure: line 7079: `PKG_CHECK_MODULES(CPPUNIT, cppunit, 
>     have_cppunit=yes, have_cppunit=no)'

Do you have pkg-config installed?

> I put in commentary the line PKG_CHECK_MODULES(CPPUNIT, cppunit,     have_cppunit=yes, have_cppunit=no) then
>   # make
>   # make install
> I took the driver voltronic_ser then from my workstation put it in the server, change the ups.conf and try it.
> The command “upscmd –u admin myups shutdown.return” now work (shutting down server then ups).
> Unfortunately, when I do “shutdown –h +0”, the ups is never shut down. After a little research, it appears that the line “upsmon –K >/dev/null 2>&1” in ups-monitor always return 1 so the line “exec /etc/init.d/nut-server poweroff” is never execute.

For initial shutdown testing, I would recommend using a dummy load (such as a lamp) and plug the server into another UPS or directly to line power.

Then, you can remove power from the UPS and run "upsmon -K" from the command line (without redirection) to see why it is failing.

> I’m ussing upssched in upsmon.conf, do I need to create the flag with my script before calling the shutdown –h +0? How (it’s supposed to be set automaticaly)? or maybe I’m missing something.

I don't recommend configuring upssched until basic shutdowns work.

> Did I do the right thing by getting only the driver from my computer and put it on the server? Or should I do a package of the whole nut (binary, conf etc...)

This is not guaranteed to work, but when the version numbers are close enough (2.6.4, 2.6.5, 2.7.1/master), it usually does work. The network protocol is more stable than the upsd/driver interface.

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsuser mailing list