Initial Path - Question...

Michael D. Setzer II mikes at kuentos.guam.net
Tue Nov 4 13:44:27 UTC 2008


On 4 Nov 2008 at 9:20, walter harms wrote:

Date sent:      	Tue, 04 Nov 2008 09:20:16 +0100
From:           	walter harms <wharms at bfs.de>
Send reply to:  	wharms at bfs.de
To:             	mikes at kuentos.guam.net
Copies to:      	busybox at busybox.net
Subject:        	Re: Initial Path - Question...

> 
> 
> Denys Vlasenko schrieb:
> > On Monday 03 November 2008 22:33, Michael D. Setzer II wrote:
> >>>> I added an export to command to the .bash_profile to fix the issue, but was
> >>>> wondering if there is a better way, or if this is how things are suppose to
> >>>> be. Not sure where the PATH value is set.
> >>> We usually inherit one in the environment from whatever program ran us.
> >>>
> >>> We used to use _PATH_STDPATH out of /usr/include/paths.h but now there's a 
> >>> hand-wired definition of bb_PATH_root_path[] in libbb/messages.h for some 
> >>> reason, and that's what ash sets its varinit_data[] to.  If it's ever 
> >>> checking the environment it inherits to see if PATH is already set, I can't 
> >>> find where...
> >> That appears to be what I was looking for. The busybox does the init for the boot up on the 
> >> cd, so it is setting the path that is used by everything.
> >>
> >> http://www.faqs.org/docs/Linux-mini/Path.html#s4
> >>
> >> Shows
> >> ===============
> >> 4. Init
> >>
> >> Init is a parent process for all the other processes of the system. Other processes inherit 
> >> environment of the init process and the path is the init path in the rare case that no other path 
> >> is set.
> >>
> >> The 'init path' is fixed in the source of the init program and it is:
> >>
> >>     /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
> >>
> >> Note that init path does not contain /usr/local/bin. 
> >> ==================
> >>
> >> The message.c shows it as:
> >> "PATH=/sbin:/usr/sbin:/bin:/usr/bin"
> >>
> >> The libbb.h has a comment that showed:
> >> util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin
> >>
> >> But in either case, I would still need to add /usr/lcoal/bin anyway..
> >> But now I at least know where it is defined??
> > 
> > No need to hack on C code. Here, shell scripts work best.
> > 
> > Have a smallish shell script somewhere in between (or instead) init
> > and other stuff you run. You can set there whatever PATH you want,
> > and two gazillion other useful things.
> > 
> > --
> > vda
> 
> hi vda you are totaly right.
> but Michael has a valid point:
> /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
> IMHO this path should NOT include /usr/local/sbin.
> system stuff is should always remain in
> /usr/bin:/bin:/usr/sbin:/sbin
> what is accidentally the default path.
> if this is your idea we should include /usr/local/sbin AND /usr/local/bin.
> 
> Micheal can you please verify that your BB_ADDITIONAL_PATH is empty ?
> Here you can specify an additional search path.

In looking at the messages.c it seems if not defined, it is set to blank

#ifndef BB_ADDITIONAL_PATH
#define BB_ADDITIONAL_PATH ""
#endif

I've just added to the .bash_profile
export PATH=/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin

That seems to work...




> 
> re,
>  wh
> 
> 
> 
> 


+----------------------------------------------------------+
  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:mikes at kuentos.guam.net                            
  mailto:msetzerii at gmail.com
  http://www.guam.net/home/mikes
  Guam - Where America's Day Begins                        
+----------------------------------------------------------+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC at HOME CREDITS
SETI 6,734,950.2088 | EINSTEIN 2,081,957.9009 | ROSETTA 668,226.5637




More information about the busybox mailing list