[Nut-upsdev] /sbin/upsdrvctl unable to shutdown UPS due to (unmounted) shared library

Michal Hlavinka mhlavink at redhat.com
Fri Aug 7 05:50:24 UTC 2009


On Thursday 06 August 2009 21:50:32 you wrote:
> Hey
>
> 2009/8/6 Charles Lepple <clepple at gmail.com>
>
> > On Aug 4, 2009, at 8:59 AM, Michal Hlavinka wrote:
> >
> >  Hi,
> >
> >> /sbin/upsdrvctl is used as the near final step in /etc/init.d/halt to
> >> command
> >> the UPS to shut down power to the computer.  On Fedora / Red Hat
> >> Enterprise
> >> Linux system, /usr can reside on its own partition.
> >
> > Would it be possible to remount /usr read-only at shutdown?

Yes, it would be possible, but I think this should work without remounting.

> that's a possible local solution, though the best is something generalised
> across the distros (a kind of best practice).

right

> Note that this is part of the NUT Packaging Standard (NPS), through the NUT
> Packager Guide.
> We are currently working with Charles on the doc (including the NPS) and
> the website.
> For a previous shot:
> http://new.networkupstools.org/
> http://buildbot.ghz.cc/~buildbot/docs/latest/asciidoc.html
>
> >  Drivers are linked to several libraries, but some of them lives in
> >
> >> /usr/lib
> >> and this can be umounted when drivers are used. There are 16 libraries
> >> used on
> >> Fedora 11 system. This prevents nut to properly shutdown ups.
> >
> > I think all of the libraries used by the NUT drivers are in /lib on
> > Debian, but Arnaud can give you more details.
> >
> > The 16 libraries might be an upper bound of what is actually being used:
> >
> >
> > https://alioth.debian.org/tracker/index.php?func=detail&aid=311810&group_
> >id=30602&atid=411542
>
> upsd + upsmon + upsdrvctl + {serial,usb} drivers must be on / (lib, bin,
> sbin)

what about other drivers? if user have specified some driver in config file, then 
this driver is always used, right?

> ie on Debian:
>     linux-gate.so.1 =>  (0xb80ac000)
>     libwrap.so.0 => /lib/libwrap.so.0 (0xb808c000)
>     libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7f29000)
>     libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7f0f000)
>     libupsclient.so.1 => /lib/libupsclient.so.1 (0xb7f07000)
>     libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7f74000)
>     libusb-0.1.so.4 => /lib/libusb-0.1.so.4 (0xb8081000)
>     linux-gate.so.1 =>  (0xb8009000)
>     libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e8f000)
>     /lib/ld-linux.so.2 (0xb800a000)

for Fedora 11, output of:

for f in `find . -maxdepth 1 -type f -executable `; do echo $f; ldd $f | grep 
/usr ; echo; done

in drivers directory after make. Drivers without any /usr/lib dependency are 
omitted.
./bcmxcp_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)

./blazer_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)

./hald-addon-bcmxcp_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)
        libhal.so.1 => /usr/lib64/libhal.so.1 (0x00000034f2e00000)        
        libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 
(0x00000034f2400000)

./hald-addon-megatec_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)
        libhal.so.1 => /usr/lib64/libhal.so.1 (0x00000034f2e00000)        
        libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 
(0x00000034f2400000)

./hald-addon-tripplite_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)
        libhal.so.1 => /usr/lib64/libhal.so.1 (0x00000034f2e00000)        
        libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 
(0x00000034f2400000)

./hald-addon-usbhid-ups
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)
        libhal.so.1 => /usr/lib64/libhal.so.1 (0x00000034f2e00000)        
        libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 
(0x00000034f2400000)
        libssl.so.8 => /usr/lib64/libssl.so.8 (0x0000003d07000000)                
        libcrypto.so.8 => /usr/lib64/libcrypto.so.8 (0x000000379c400000)          
        libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 
(0x0000003d06c00000)
        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x0000003d06800000)              
        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00000036f6200000)      
        libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 
(0x00000036f5200000)

./megatec_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)

./netxml-ups
        libneon.so.27 => /usr/lib64/libneon.so.27 (0x00000033bb800000)
        libgnutls.so.26 => /usr/lib64/libgnutls.so.26 (0x000000302c200000)
        libpakchois.so.0 => /usr/lib64/libpakchois.so.0 (0x0000003702200000)
        libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 
(0x0000003d06c00000)
        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x0000003d06800000)              
        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00000036f6200000)      
        libtasn1.so.3 => /usr/lib64/libtasn1.so.3 (0x0000003703c00000)            
        libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 
(0x00000036f5200000)

./powerman-pdu
        libpowerman.so.0 => /usr/lib64/libpowerman.so.0 (0x00000031d2000000)

./richcomm_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)

./snmp-ups
        libcrypto.so.8 => /usr/lib64/libcrypto.so.8 (0x000000379c400000)
        libsensors.so.4 => /usr/lib64/libsensors.so.4 (0x00000036ede00000)
        libnetsnmp.so.15 => /usr/lib64/libnetsnmp.so.15 (0x000000379cc00000)

./tripplite_usb
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)

./usbhid-ups
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)
        libssl.so.8 => /usr/lib64/libssl.so.8 (0x0000003d07000000)
        libcrypto.so.8 => /usr/lib64/libcrypto.so.8 (0x000000379c400000)
        libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 
(0x0000003d06c00000)
        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x0000003d06800000)
        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00000036f6200000)
        libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 
(0x00000036f5200000)

complete list of libraries:
$ for f in `find . -maxdepth 1 -type f -executable `; do ldd $f | grep /usr ; 
done | sort | uniq
        libcrypto.so.8 => /usr/lib64/libcrypto.so.8 (0x000000379c400000)
        libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 
(0x00000034f2400000)
        libgnutls.so.26 => /usr/lib64/libgnutls.so.26 (0x000000302c200000)
        libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 
(0x0000003d06c00000)
        libhal.so.1 => /usr/lib64/libhal.so.1 (0x00000034f2e00000)
        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00000036f6200000)
        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x0000003d06800000)
        libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 
(0x00000036f5200000)
        libneon.so.27 => /usr/lib64/libneon.so.27 (0x00000033bb800000)
        libnetsnmp.so.15 => /usr/lib64/libnetsnmp.so.15 (0x000000379cc00000)
        libpakchois.so.0 => /usr/lib64/libpakchois.so.0 (0x0000003702200000)
        libpowerman.so.0 => /usr/lib64/libpowerman.so.0 (0x00000031d2000000)
        libsensors.so.4 => /usr/lib64/libsensors.so.4 (0x00000036ede00000)
        libssl.so.8 => /usr/lib64/libssl.so.8 (0x0000003d07000000)
        libtasn1.so.3 => /usr/lib64/libtasn1.so.3 (0x0000003703c00000)
        libusb-0.1.so.4 => /usr/lib64/libusb-0.1.so.4 (0x00000036fe600000)


>
> only snmp-ups and netxml-ups have deps outside, but the late shutdown
> doesn't apply here.
> the same goes for the powerman and CGI parts, which are out of the scope of
> such behavior.
>
> as a side note, more and more UPSs are smart nowadays, and provides delayed
> shutdown.
>
> one of my future task, part of the NPS, will be to make this the default,
> though still permitting the late shutdown. there is even possibly a way to
> automate this, so that it's transparent to the user...
>
> >  How is this designed to work? Is it expected all drivers are linked
> >
> >> statically? 16 libraries does not seem to me as unexpectedly placed to
> >> /usr/lib instead of /lib
> >
> > Not sure I understand the "unexpectedly placed" part.
>
> seconded.

Meaning of this is: Because number of libraries in /usr/lib is quite big I 
presume it's not expected to have all this libraries in /lib

Cheers,
Michal



More information about the Nut-upsdev mailing list