sudo wasn't designed to do that. your original post indicated that you
wanted sudo to execute a shell, which is what su does. your problem is that
you are attempting to execute something that isn't in your path. since you
aren't actually running the command as root (ie, there is no login context),
sudo doesn't provide root's environment. you are running with an effective
uid of root which is slightly different.

put the appropriate dirs into your path and you should be fine. alternately,
i seem to recall that some versions of su provide a switch like -c which
allows you to specify a command. i don't remember if that spawns an
appropriate environment (which is really what you are looking for) or if you
could tag a - (which would inherit the correct environment vars, run the
login scripts, etc).

if i'm completely dazed and providing incorrect information, i'm sure
someone will correct me.


----- Original Message -----
From: "William Hubbs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 31, 2003 2:32 PM
Subject: [gentoo-user] Re: sudo not setting the path (was sudo not running a
shell as a login shell)


> Hi Rick and all,
>
> The problem appears to be that for some reason, sudo doesn't put the
/usr/sbin and /sbin directories in the path.
> That means that if I do the following:
>
> sudo [command]
>
> where command is in /sbin or /usr/sbin, I get a message that says
>
> sudo:  [command] not found
>
> I am using the /etc/sudoers file that comes with emerging sudo, with the
line uncommented that allows users in the wheel group to run commands as
root with their passwords, and the user is in the wheel group.  What am I
missing?
>


--
[EMAIL PROTECTED] mailing list

Reply via email to