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

Bug 219151

Summary: net-ftp/frox - Init scripts using basename cause errors when evaluating service dependencies
Product: Gentoo Linux Reporter: Jeroen Roovers (RETIRED) <jer>
Component: Current packagesAssignee: Daniel Black (RETIRED) <dragonheart>
Status: RESOLVED FIXED    
Severity: trivial CC: gentoo
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jeroen Roovers (RETIRED) gentoo-dev 2008-04-24 15:41:40 UTC
+++ This bug was initially created as a clone of Bug #218397 +++

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 Daniel Black (RETIRED) gentoo-dev 2008-05-01 13:42:23 UTC
fixed - thankyou.