Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 322083

Summary: sys-power/nut-2.4.3: /etc/init.d/nut.powerfail: keyword: command not found
Product: Gentoo Linux Reporter: DEMAINE Benoît-Pierre, aka DoubleHP <dhp_gentoo>
Component: Current packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal CC: dflogeras2, jer, tm
Priority: High    
Version: 10.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: /tmp/emerge--info

Description DEMAINE Benoît-Pierre, aka DoubleHP 2010-05-30 14:04:09 UTC
Sometimes, not every day, some times at boot time (or not), or shutdown (or not), I get this error message:

uranus ~ # /etc/init.d/munin-node restart
 * Caching service dependencies ...
/var/lib/init.d/depcache: line 2239: keyword: command not found
 *  Can't find service 'mount-ro' needed by 'nut.powerfail';  continuing  [ ok ]
 * Stopping munin-node ...                                                [ ok ]
 * Starting munin-node ...                                                [ ok ]
uranus ~ # grep -nri mount-ro /etc/
/etc/init.d/nut.powerfail:9:    need mount-ro
uranus ~ # grep -nri powerfail /etc/
/etc/init.d/nut.powerfail:4:# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/files/nut.powerfail.initd,v 1.1 2010/01/09 20:17:32 robbat2 Exp $
/etc/init.d/nut.powerfail:19:   elif [ -f /etc/apcupsd/powerfail ]; then
/etc/init.d/nut.powerfail:23:           ewarn "UPS powerfail script scheduled, but no poweroff commands found."
/etc/init.d/halt.sh:127:        elif [[ -f /etc/apcupsd/powerfail ]] ; then
uranus ~ # cd /etc/
uranus etc # find | grep -i mount-ro
uranus etc #

I don't know why munin depends on NUT (and this is offtopic); I don't know if the bug is on nut depending on non existing service, or in keyword not found.

And I don't understand why I get this message only some times. Today, I had not it at boot, i got it now.
Comment 1 Richard Scott 2010-06-17 09:57:59 UTC
munin doesn't depend on Nut, its just that you've installed nut since last running any /etc/init.d script. The system caches these scripts and checks their syntax as it goes.

You can run this caching by hand: depscan.sh -u and you should see the error again.

Rich.
Comment 2 DEMAINE Benoît-Pierre, aka DoubleHP 2010-06-17 10:13:56 UTC
uranus ~ # depscan.sh -u
 * Caching service dependencies ...
/var/lib/init.d/depcache: line 2245: keyword: command not found
 *  Can't find service 'mount-ro' needed by 'nut.powerfail';  continuing  [ ok ]
uranus ~ # depscan.sh -u
 * Caching service dependencies ...
/var/lib/init.d/depcache: line 2245: keyword: command not found
 *  Can't find service 'mount-ro' needed by 'nut.powerfail';  continuing  [ ok ]
uranus ~ #

is this normal ?
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-17 18:50:49 UTC
Where is your emerge --info?

What version of baselayout are you running? That script is designed for baselayout2.

Your summary is wrong, the script DOES correctly depend on mount-ro.
$ grep mount-ro /etc/init.d/nut.powerfail 
	need mount-ro
Comment 4 DEMAINE Benoît-Pierre, aka DoubleHP 2010-06-17 19:26:07 UTC
Created attachment 235789 [details]
/tmp/emerge--info

sys-apps/baselayout-1.12.13

my old summary was not pointing the script, but, respecting this bugzilla habits, was poiting the atom/ebuild name-version. I meant that, if the ebuild should include a dep that is, for me, not actually in the ebuild. And especially, if a script "generated" by the ebuild depends on whatever, the ebuild must depend on the "other ebuild that will provide it".

So, the problem may be related to an unmasked nut ? grep says:
/etc/portage/package.keywords/autounmask-nut:5:=sys-power/nut-2.4.3 ~amd64
what may be the explanation you are looking for. I needed to unmask =sys-power/nut-2.4.3 on May 25 09:26:27; but I forgot why. Deep analysis of my logs could help me remind, but I think you don't bother.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-17 19:28:21 UTC
Ok, i'll modify that script to not be used with baselayout1.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-17 19:39:18 UTC
Fixed in CVS.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-23 02:00:40 UTC
*** Bug 324609 has been marked as a duplicate of this bug. ***