who called sudo ?
Derek Broughton
news at pointerstop.ca
Sat Mar 15 15:02:10 UTC 2008
Karl Larsen wrote:
> dave selby wrote:
>>
>> I am writing an install script that needs to be root, its started with
>>
>> sudo install.py
>>
>> It needs to know who was the user that executed 'sudo install.py' ...
>> any ideas how I get that info from the shell or sudo command ?
>>
> If it is an install script there is no user identified so sudo can't
> work. You need to figure out what your going to use this for and make
> sure it can be used.
Clearly not true:
$ sudo -i
root at bella:~# echo $SUDO_USER
derek
As for what you might use it for, I can imagine countless situations. Say
you want to install a product with an "initial user" - who better to make
the initial user than the actual person who does the install, who clearly
has the privilege to set themselves up, anyway, and is also the only
account you can immediately tell ever gets used.
Karl, don't automatically assume the poster doesn't have a clue.
--
derek
More information about the ubuntu-users
mailing list