Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 218397 - Init scripts using basename cause errors when evaluating service dependencies
Summary: Init scripts using basename cause errors when evaluating service dependencies
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-19 11:59 UTC by Robin Hill
Modified: 2008-04-24 15:44 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Hill 2008-04-19 11:59:42 UTC
Various ebuilds are using init scripts (presumably based from a standard template) which start off with "PROGNAME=`basename $1`".

When the system has to re-evaluate the dependencies (when starting/stopping a service after an init script has changed) then the following error appears (repeated once for each init script containing this code):
    basename: missing operand
    Try `basename --help' for more information.

Replacing `basename $1` with the name of the init script fixes the issue.  Alternately the init system should be changed to evaluate this (or other similar) code correctly when it comes across it during the service dependency evaluation.

This doesn't appear to actually affect the results of the evaluation, merely causes unwanted (and confusing) error messages.

Ebuilds I've found using this code are:
    app-admin/prelude-manager
    app-admin/prelude-lml
    net-ftp/frox

That's from a grep through the portage tree - just my luck I've got them all installed.

Reproducible: Always

Steps to Reproduce:
1. Install one of the affected ebuilds.
2. Run "touch /etc/init.d/numlock" to force a re-evaluation of the dependencies.
3. Run "/etc/init.d/numlock start" (or stop if already started).

Actual Results:  
 * Caching service dependencies ...
basename: missing operand
Try `basename --help' for more information.                               [ ok ]
 * Enabling numlock on ttys ...                                           [ ok ]

Expected Results:  
 * Caching service dependencies ...                                       [ ok ]
 * Enabling numlock on ttys ...                                           [ ok ]
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-04-19 16:31:54 UTC
If base-system agrees this is a problem, then it's probably a good idea to CC netmon@ and dragonheart@
Comment 2 SpanKY gentoo-dev 2008-04-19 20:38:08 UTC
not a bug in baselayout/openrc ... any init.d script that does:
PROGNAME=`basename $1`

is broken and needs fixing
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2008-04-24 15:44:49 UTC
I've created two new bug reports assigned to the appropriate maintainers so that this bug can be closed. Thanks for reporting.