I have just installed 11.2 i686 on two machines, one virtual and one physical. Both have been set to start in runlevel 3. For some reason it seems that my installations have missed some step in the process, because the system cannot find several rather important commands, eg. init and ifconfig.
this is what I get if I try to run ifconfig:
user@computer:~> sudo ifconfig
sudo: ifconfig: command not found
but if I go into /sbin/ the actual files are there and I can run them locally. Can anyone explain what has happened here and perhaps tell me how I can fix this?
sudo runs the command with your $PATH. And /sbin is normally not on a user’s $PATH. One fix is to add /sbin to your $PATH. Another is to use sudo -i. Hmm, are you coming from Ubuntu?
On 12/20/2009 03:26 PM, madcatmkii wrote:
>
> Hello
>
> I have just installed 11.2 i686 on two machines, one virtual and one
> physical. Both have been set to start in runlevel 3. For some reason it
> seems that my installations have missed some step in the process,
> because the system cannot find several rather important commands, eg.
> init and ifconfig.
>
> this is what I get if I try to run ifconfig:
>
>
> Code:
> --------------------
>
> user@computer:~> sudo ifconfig
> sudo: ifconfig: command not found
>
> --------------------
>
>
> but if I go into /sbin/ the actual files are there and I can run them
> locally. Can anyone explain what has happened here and perhaps tell me
> how I can fix this?
Use /sbin/ifconfig as /sbin is not in your path. You could add /sbin
to your pat statement, but I’m not going to tell you how to do that.
If you really want to, you need to do the research for it.
Yeah, I am I suppose there is some sadistic logic to having to actually use the su-account but when even openBSD allows you to shut the machine down using sudo I sort of assumed it was common practice… Well, I suppose I had better get used to these primitive conditions then
It’s just a consequence of the way sudo works. Sudo doesn’t alter the $PATH unless it’s asked to. There is some justification in adding /sbin and /usr/sbin to your $PATH, it allows you to use programs like ifconfig without prefixing /sbin, if all you want is to look at the current config, which doesn’t require root privilege.
This is Linux, no need to whinge, just modify it to how you like it.
On 12/20/2009 04:16 PM, madcatmkii wrote:
>
> ken_yap;2091067 Wrote:
>> sudo runs the command with your $PATH. And /sbin is normally not on a
>> user’s $PATH. One fix is to add /sbin to your $PATH. Another is to use
>> sudo -i. Hmm, are you coming from Ubuntu?
>
> Yeah, I am I suppose there is some sadistic logic to having to
> actually use the su-account but when even openBSD allows you to shut the
> machine down using sudo I sort of assumed it was common practice…
> Well, I suppose I had better get used to these primitive conditions then
What primitive conditions? All distros are different, and yes, I can
shut down my machine using ‘sudo /sbin/shutdown’.
I’m sorry, I was trying to play a joke on Ubuntus’ reputation as a more user-friendly linux and the fact that ken_yap managed to pick me out as an ubuntu-user right away. It wasn’t meant as an attack on you in any way and I apologize.
>
> lwfinger;2091097 Wrote:
>> On 12/20/2009 04:16 PM, madcatmkii wrote:
>> >
>> > ken_yap;2091067 Wrote:
>> >> sudo runs the command with your $PATH. And /sbin is normally not on
>> a
>> >> user’s $PATH. One fix is to add /sbin to your $PATH. Another is to
>> use
>> >> sudo -i. Hmm, are you coming from Ubuntu?
>> >
>> > Yeah, I am I suppose there is some sadistic logic to having to
>> > actually use the su-account but when even openBSD allows you to shut
>> the
>> > machine down using sudo I sort of assumed it was common practice…
>> > Well, I suppose I had better get used to these primitive conditions
>> then
>>
>> What primitive conditions? All distros are different, and yes, I can
>> shut down my machine using ‘sudo /sbin/shutdown’.
>
> I’m sorry, I was trying to play a joke on Ubuntus’ reputation as a more
> user-friendly linux and the fact that ken_yap managed to pick me out as
> an ubuntu-user right away. It wasn’t meant as an attack on you in any
> way and I apologize.
Unfortunately, madcatmkii, you are apologizing to someone with absolutely no
sense of humor.