Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 346561 - sys-power/nut: UPS shutdown by usb fails due to usb no longer exists at system shutdown
Summary: sys-power/nut: UPS shutdown by usb fails due to usb no longer exists at syste...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major with 1 vote (vote)
Assignee: Robin Johnson
Depends on:
Reported: 2010-11-23 20:21 UTC by Martin
Modified: 2023-06-17 03:18 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2010-11-23 20:21:14 UTC
NUT 2.4.3-r2: upsdrv, upsd and upsmon all start up fine.

The attached UPS is a Liebert Powersure XT connected via usb using "/lib/nut/usbhid-ups -a liebert"

Trying a user generated forced shutdown from root using "upsdrvctl -u nut shutdown" shuts the system down but not the UPS. The console log displays at the end the error message:

Shutdown failed
Driver failed to start

Is the problem that "usbhid-ups" and the usb have already been shut down?

For example, a UPS initiated shutdown gives in the logs:

01:27:34  shutdown[22454]: shutting down for system reboot
01:27:38  init: Switching to runlevel: 6

01:27:46  upsmon[22313]: Signal 15: exiting
01:27:46  upsd[5448]: User nut@ logged out from UPS [liebert]
01:27:46  upsmon[22311]: upsmon parent: read
01:27:47  upsd[5448]: mainloop: Interrupted system call
01:27:47  upsd[5448]: Signal 15: exiting
01:27:47  usbhid-ups[22199]: Signal 15: exiting

01:28:21  mountd[4456]: Caught signal 15, un-registering and exiting.

01:28:21  rpc.statd[4382]: Caught signal 15, un-registering and exiting.

01:28:27  syslog-ng[4006]: Termination requested via signal, terminating;
01:28:27  syslog-ng[4006]: syslog-ng shutting down; version='3.1.2'

Logging to file stops at this point. Further logging is shown on the screen including:

Shutdown failed
Driver failed to start

The system must then be manually reset/restarted, the UPS remains on.

Reproducible: Always

Steps to Reproduce:
1.Cause a forced shutdown either by removing mains input or by giving upsdrvctl command
2. The PC runs through a shutdown sequence
3. Shutdown fails to complete

Actual Results:  
The PC appears to halt but remains powered up, and the UPS remains powered up.

Expected Results:  
Graceful shutdown of the PC followed by shutdown (auto power off) of the UPS. Followed by upon reapplication of mains power to the UPS: UPS power up and PC power up.


*  sys-power/nut
      Latest version available: 2.4.3-r2
      Latest version installed: 2.4.3-r2
      Size of files: 1,127 kB
      Description:   Network-UPS Tools
      License:       GPL-2

Curiously, the upscmd command lists no 'instant' commands:

# upscmd -l liebert
Instant commands supported on UPS [liebert]:

Also note that the powerdown flag is "/etc/killpower". Does the nut user require write access to /etc to set that?...
Comment 1 Martin 2010-11-23 20:25:30 UTC
This is on:

2.6.34-gentoo-r12 #1 SMP Thu Oct 28 18:02:35 BST 2010 x86_64 Intel(R) Atom(TM) CPU D510 @ 1.66GHz GenuineIntel GNU/Linux

emerge fully up to date.

Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-12-09 19:32:52 UTC
Please post your `emerge --info' in a comment.
Comment 3 Martin 2010-12-09 22:29:45 UTC
Portage (default/linux/amd64/10.0/server, gcc-4.4.4, glibc-2.11.2-r3, 2.6.34-gentoo-r12_ml_atom21 x86_64)
System uname: Linux-2.6.34-gentoo-r12_ml_atom21-x86_64-Intel-R-_Atom-TM-_CPU_D510_@_1.66GHz-with-gentoo-1.12.14
Timestamp of tree: Tue, 07 Dec 2010 23:30:01 +0000
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
CFLAGS="-march=core2 -mtune=core2 -mcx16 -msahf -mmmx -msse -msse2 -msse3 -mssse3 -mfpmath=sse -Os -pipe -fomit-frame-pointer --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-s
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-re
build /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -mtune=core2 -mcx16 -msahf -mmmx -msse -msse2 -msse3 -mssse3 -mfpmath=sse -Os -pipe -fomit-frame-pointer --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X acl amd64 berkdb bzip2 cgi cli cracklib crypt cxx dkim dri ffmpeg fortran gdbm gnutls gpg gpm gstreamer iconv jpeg jpeg2k mmx modules mudflap multilib ncurses nls nptl nptlonly opengl openmp p
am pcre png readline sasl session snmp spamassassin sse sse2 sse3 ssl ssse3 symlink sysfs tcpd tiff truetype unicode usb v4l v4l2 vim-syntax xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-m
odem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix
 dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias au
thn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires e
xt_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df i
nterface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore
 rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LI
NGUAS="en" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition
 tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2011-04-28 06:29:34 UTC
I guess it won't change this bug, but just for the record, can you try 2.6.0 too?
Comment 5 Billy DeVincentis 2012-05-02 12:47:10 UTC
Is there anything able to be done about this?
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-08-12 06:33:07 UTC
In the case of a powerfail shutdown, we need the UPS services to NOT be stopped at all. Suggestions welcomed as to how to do this sanely.

We need these services to stay up:
upsdrv* (either base or symlinked to upsdrv)
Comment 7 William Hubbs gentoo-dev 2013-08-16 05:38:41 UTC
You might look into setting up a powerfail or powerwait line in
/etc/inittab and have a custom runlevel with only the ups services in
it. You will also probably need a powerokwait line.

Check man inittab for the info; let me know if you want me to write
something up. I won't be able to test I don't think since I do not have
the ups.

Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-08-16 15:44:17 UTC
If you want to write it, I can test it, having multiple UPS & systems.