Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88832 - www-apps/nut 2.0.0-r1 creates link to upsdrvctl in /usr/sbin, should be in /sbin
Summary: www-apps/nut 2.0.0-r1 creates link to upsdrvctl in /usr/sbin, should be in /sbin
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on: 103132
Blocks:
  Show dependency tree
 
Reported: 2005-04-12 04:33 UTC by Dafo
Modified: 2006-05-17 23:08 UTC (History)
2 users (show)

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


Attachments
Diff to fix this bug (nut-2.0.1_pre4.ebuild.diff,868 bytes, patch)
2006-03-14 07:33 UTC, Niels Laukens
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dafo 2005-04-12 04:33:23 UTC
On power failure the system shuts down but doesn't kill the power on UPS.

Reproducible: Always
Steps to Reproduce:
1. emerge www-apps/nut
2. touch /etc/killpower
3. shutdown -h +0

Actual Results:  
The shutdown process after remounting root fs read only, doesn't attempt to 
send shutdown command to UPS.

Expected Results:  
* Remounting remaining filesystems readonly...
* Signalling ups driver(s) to kill the load!

In /etc/init.d/halt.sh script ups_kill_power function checks for
  [ -x /sbin/upsdrvctl ]
However, the ebuild installs the link to /usr/lib/nut/upsdrvctl in /usr/sbin.
This link should be created in /sbin.
Comment 1 Christophe PEREZ 2005-04-27 14:55:27 UTC
I confirm that bug, and it's not alone.
Symlink won't work on a separate file system.

Also, all drivers are in /usr/lib/nut/*
And, if /usr is umounted, even if I copied upsdrvctl to /sbin, it can't powerdown UPS because it can't find my driver (powercom).

The only solution I found is :
cp /usr/sbin/upsdrvctl /sbin
cp -a /usr/lib/nut/ /lib/
and add this option in my /etc/nut/ups.conf :
driverpath = /lib/nut

Ebuild could use that path, or another, but not a path in /usr that is often on a separate file system from root.
I spent a lot of time to find the real problem.

Other thing, I had to put that in my /etc/conf.d/local.start :
chown nut\:nut /dev/tts/0
chmod 0600 /dev/tts/0

because I couldn't make udev to do it...
May be I didn't need it, but I was looking for a solution to my PC powerdown UPS...

Sorry for my bad english.
Comment 2 Renat Lumpau (RETIRED) gentoo-dev 2005-07-03 11:28:01 UTC
This ain't webapps. Reassigning.
Comment 3 Niels Laukens 2005-08-19 15:05:38 UTC
the problem is worse:
I use newhidups and it needs libusb, so that file must also exist on non-/usr.
and another problem is that /proc/bus/usb has to remain mounted.....

I'll try to fit it all in an ebuild, but it'll be difficult to do this "clean"
Comment 4 Niels Laukens 2005-08-20 05:46:18 UTC
I submitted the patch in bug #85296
Comment 5 Niels Laukens 2006-03-14 07:33:22 UTC
Created attachment 82100 [details, diff]
Diff to fix this bug

This problem is still present in the 2.0.1_pre4 release. This patch solves it (probabely not in a very clean way)
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-05-17 22:45:54 UTC
For the lib move, there is bug #103132.
For everything else, I'm commiting the change in a moment.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-05-17 23:08:54 UTC
Fixed in CVS for 2.0.3.

I do have one question for shutdowns however.
upsdrvctl invokves /lib/nut/$driver -a $UPSNAME -k

Does this shut down with shutdown.return or load.off?