Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jun 18, 2005 2:57 pm 
Offline
Senior Member

Joined: Sat Mar 19, 2005 3:29 pm
Posts: 50
Website: http://ryantate.com
Location: Berkeley, CA
Hello all,

I've been scouring my $60 "Unix System Administration Handbook (3rd ed)," read the Linux and Debian FAQs, rooted around in the bash documentation, Googled and Google Groupd, and still can't figure this out:

How do I view and edit the default paths used on a systemwide basis to locate binaries?

For example, to use grep you just type "grep pattern file", not "/bin/grep pattern file". I want to do that with apachectl, which is in /usr/local/apache2/bin. What is the definitive method of controlling this, and the best practice for actually doing it?

I know about individual .bashrc files, but in some cases I want systemwide program aliases.

Thanks for any help!


Top
   
 Post subject:
PostPosted: Sat Jun 18, 2005 3:11 pm 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
I don't believe there is such an animal as a systemwide path. You can modify the /etc/skel/.bashrc file to have a certain path get to newly created users.

You could also make up a file describing a path, and have everybody's .bashrc refer to that file. That's a pretty good simulation of a systemwide path.


Top
   
 Post subject:
PostPosted: Sat Jun 18, 2005 3:50 pm 
Offline
Senior Newbie

Joined: Mon Apr 11, 2005 11:08 am
Posts: 8
Rather than having aliases in your .bashrc files you could link the program into a bin directory. This is ok for the odd program, but probably not if you wanted a full directory to be processed in this way (in which case you would probably want to add the directory to the PATH variable - however this can be dangerous if not done correctly :)).

In simple terms, if a programs name can simply be typed in at the command line (such as grep rather than /bin/grep) - it is *usually* because it is in a ./bin directory (such as /bin, /usr/local/bin), or some directory that is in the PATH variable. -- if you want the same feature for programs which are in strange directories (such as that of /usr/local/apache2/bin/apachectl), then your best bet is probably to simply create a symbolic link to this executable in your /usr/local/bin directory, for example in your case:

ln -s /usr/local/apache2/bin/apachectl /usr/local/bin/apachectl

this will enable you to simply type 'apachectl' at the command line to execute the command.


Forgive me if this is not what you are asking - I'm very tired hehe... but it seems a simple solution to your problem :)


Thanks,
Shaun


Top
   
 Post subject:
PostPosted: Sat Jun 18, 2005 7:22 pm 
Offline
Senior Member

Joined: Sat Mar 19, 2005 3:29 pm
Posts: 50
Website: http://ryantate.com
Location: Berkeley, CA
Interesting. The reason I thought something must be setting paths systemwide is that my own rootly .bashrc file contains no special attempt to set $PATH or any aliases.

_Something_ must be setting $PATH, right??

Thanks for the link suggestion, that seems to be working well! /usr/local/bin seems like the appropriate place. If mysql can dump a bunch of random scripts in there, so can I! ;->


Top
   
 Post subject:
PostPosted: Sat Jun 18, 2005 7:32 pm 
Offline
Senior Member
User avatar

Joined: Fri Aug 15, 2003 2:15 pm
Posts: 111
Website: http://fubegra.net/
Look for /etc/profile and edit the PATH variable that is set therein.

_________________
Bus error (passengers dumped)


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2005 4:58 am 
Offline
Senior Member

Joined: Fri Aug 06, 2004 5:49 pm
Posts: 158
I'm surprised RJP's post wasn't the first reply...


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2005 11:44 pm 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
Learn something new every day. Thanks for the tip, rjp!


Top
   
 Post subject:
PostPosted: Tue Jun 21, 2005 4:37 pm 
Offline
Senior Member

Joined: Sat Mar 19, 2005 3:29 pm
Posts: 50
Website: http://ryantate.com
Location: Berkeley, CA
/etc/profile. brilliant, thanks.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: Dweeber and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group