Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 14127 - init.d scripts inherit path of caller
Summary: init.d scripts inherit path of caller
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-17 21:44 UTC by Aron Griffis (RETIRED)
Modified: 2003-01-19 17:36 UTC (History)
1 user (show)

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 Aron Griffis (RETIRED) gentoo-dev 2003-01-17 21:44:02 UTC
It seems a problem that init.d scripts inherit the PATH of their caller.  It
seems like runscript should be setting the PATH to the sane default obtained
from profile.env.  This is important because otherwise init.d scripts can fail
unexpectedly, for example...

sesame /proc/20820 # PATH=/ /etc/init.d/distccd stop
/sbin/runscript.sh: line 1: cat: command not found
/sbin/runscript.sh: line 198: cat: command not found
/sbin/runscript.sh: line 205: rm: command not found
 * ERROR:  "/etc/init.d/distccd" has syntax errors in it; not executing...

Granted, this is a pretty contrived situation, but it demonstrates the problem.
 In my real-world situation, the problem was that distccd couldn't find gcc in
its new location.  Fetching the new environment settings from profile.env would
have solved that issue.  This should probably be the behavior for ALL init.d
scripts.

Aron
Comment 1 SpanKY gentoo-dev 2003-01-17 22:09:36 UTC
if you update/reemerge distcc it'll find gcc correctly
a fix was added to get the path of gcc and passing it to distcc
Comment 2 Aron Griffis (RETIRED) gentoo-dev 2003-01-18 11:19:31 UTC
Thanks for the distcc tip.  However perhaps the example got in the way of the
bug.  It still seems wrong that init.d scripts inherit the PATH of their caller...

Aron
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-19 17:36:20 UTC
Will be fixed on CVS shortly, should be in baselayout-1.8.6.3.