LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-01-2002, 10:17 AM   #1
radnix
Member
 
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48

Rep: Reputation: 15
Question which /sbin redirect


Basically, when typing in the "which" command, I'm shown that a particular program that is the default is located in /sbin [i.e. such as apachectl ]

If I install a newer version and its executable is located in a different directory [i.e. /usr/local/apache/bin/apachectl], I'm still gonna' execute the origional /sbin apachectl.

How may I eliminate the /sbin executable and cause the system to think that my new installations are the default programs to select?

info : RedHat 7.3 web server setup.

Thanks ahead............. |;-)
 
Old 09-01-2002, 10:42 AM   #2
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
1. If you don't want the prog in /sbin, remove it and make a link to prog in /usr/local.../bin.
2. If you want any prog to be found before the other, just change your path to check the specific directory first.
(Eg. export PATH=/usr/local...:$PATH )

But I am not familiar with apachae server. May be that prog starts from some file and you might have to modify that.
--Sarin
 
Old 09-01-2002, 01:42 PM   #3
radnix
Member
 
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48

Original Poster
Rep: Reputation: 15
oohhhh yea.....save/rename origional program, then create link using same name, re-directed to the proper program I wish to run. Great! Works fine.

Placed in the /usr/sbin directory :
ln -s /usr/local/apache/bin/apachectl apachectl

I do still wonder what origionally deceided that the programs in /usr/sbin were the "Which" or primary programs to be run.

Much thanks for your help!
 
Old 09-01-2002, 01:52 PM   #4
radnix
Member
 
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48

Original Poster
Rep: Reputation: 15
ooppps, I should of read the entire reply :

2. If you want any prog to be found before the other, just change your path to check the specific directory first.
(Eg. export PATH=/usr/local...:$PATH )

Does that mean that The first instance of any given program will superceed a second one of the same name based on the sequence of pathing listed in the $PATH variable ?

ex :
apachectl is both in -
1. /usr/sbin
2./usr/local/apache/bin

If the $PATH is set as - /usr/sbin : /usr/local/apache/bin

it will distinguish the one in /usr/sbin as first choice ?

sorry, don't mean to be confusing.
 
Old 09-01-2002, 03:50 PM   #5
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
that is right. The system goes thru the entries in you PATH one by one till it finds the first executable with the name you typed.

BTW, did you install a later version of apache by yourself than the one that comes with RH7.3?

If you did, you might want to configure --with-layout=RedHat ( --enable-layout for apache 2.0.40, I think. See configure --help and config.layout )so that it will install the things you want where RedHat wants it.

So you will be able to type /etc/rc.d/init.d/httpd (start|stop) or /sbin/service httpd (start|stop) .. as root of course.

First, there were distributions. God said "Let there be LSB."
 
Old 09-01-2002, 04:32 PM   #6
radnix
Member
 
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48

Original Poster
Rep: Reputation: 15
Thumbs up

Yes, I did a tarball installation to embed PHP 4.0 in Apache.

I'll readup / use --with-layout parameter on my next install, as you suggest.

Very interresting, much thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/sbin/rc: line 271: /sbin/devfsd: No such file or directory Alexander.s Linux - General 3 04-22-2005 04:44 PM
Want2use /sbin cmds undr non-root account w/o sudo. Is it safe 2 add /sbin 2 my PATH? kornerr Linux - General 4 02-25-2005 09:29 AM
/usr/sbin and /sbin world read/executable... why? lazlow69 Slackware 3 04-29-2004 05:06 PM
As root, not seeing /sbin and /usr/sbin in path weghman Linux - Newbie 3 04-25-2004 01:06 PM
/sbin/clock and /sbin/hwclock: out of memory problems victor2000 Linux - General 0 07-29-2003 03:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration