Re: bash script kdesu root privilege problem

Todd and Margo Chester <[email protected]> Mon, 25 Feb 2008 11:29:26 -0800
Newsgroups gmane.comp.kde.k3b
Message-ID <[email protected]>
Todd and Margo Chester wrote:
>> On Sunday 17 February 2008 05:19:57 pm Todd and Margo Chester wrote:
>>> Hi All,
>>>
>>> I am using k3b-0.12.17-1.el5 on CentOS 5.1 (RHEL 5.1 clone).
>>>
>>> I can run k3b as any user and as root perfectly.
>>>
>>> But, when I run K3B from a bash script as
>>> a user and try to elevate k3b to get root privileges,
>>>
>>>      #! /bin/bash
>>>       kdesu -n -u root -c "k3b --nofork"
>>>
>>> I get all kinds of the following errors:
>>>
>>>          Unable to find growisofs executable
>>>          K3b uses growisofs to actually write dvds.
>>>          Without growisofs you won't be able to write
>>>          dvds. Make sure to install at least version
>>>          5.10.  Solution: Install the dvd+rw-tools package.
>>>
>>> What am I doing wrong?
>>>
>>> Many thanks,
>>> -T
>>> p.s. sudo does not work either
>>>
> 
> Jeff Adams wrote:
>  > Todd;
>  >
>  > Check the default path for bash in /etc/profile.
>  > I suspect it does not contain the location where growisofs is located.
>  >
>  > Jeff
>  >
>  >
> 
> Hi Jeff,
> 
>     You called it.  Added "/usr/bin" to /etc/profile and
> that did the trick.  Thank you!
> 
> -T

Oh poop!  Spoke too soon.  The above modification to /etc/profile
fixed running from the command line, but not from a bash
script.

Somewhere I remember there is a different path scheme for
interactive command (the command line) and non-interactive
scripts (bash scripts).  Any idea how to fix the non-interactive
path?

Many thanks,
-T

p.s. k3b is in /usr/bin.  And so is everything else it can't
find.  What a pain!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/