Re: [opensuse] Running a program as root from desktop panel



This is obviously to launch a program from my panel as I mentioned and
I'm obviously not root so there is no need to make a script which is
going a bit beyond of what I wanted to do. I guess if I had kde
installed the kdesu <program> would have worked but since I don't then
a better answer would have been gnomesu.

Anyways I've found gksu which is actually the right answer because it
doesn't require gnome or kde and it solves my problem. No need to make
it into a script or anything..

Thanks,
- Jake

On 10/11/07, Jonathan Ervine <jervine@xxxxxxxxxx> wrote:
On Friday 12 October 2007 00:57:31 Jake Conk wrote:
No you misunderstood, good try though.

Grrr... top-posting. You're breaking the logic of the thread. I'd say Roger
understood perfectly what you're trying to achieve. He's given you a solution
based on KDE, but it's a trivial adaptation for GNOME (which you've already
mentioned you've got).

sudo is going to be a waste of time, as it will be expecting a terminal
console in which to enter the password to allow privileged access. However,
if you look at Roger's script he's checking to see if the current user is id
0 (this is root by the way). If it is, then the application is launched. If
not, then it launches the application via kdesu. kdesu, in case you didn't
know, is a 'wrapper' binary that prompts for the root password to launch a
privileged application. It's how YaST2 is launched in the KDE desktop
environment.

Now as you mentioned you've got GNOME available you might want to look again
at Roger's script, and google for gnomesu

Jon

On 10/11/07, Roger Oberholtzer <roger@xxxxxx> wrote:
On Thu, 2007-10-11 at 03:57 -0700, Jake Conk wrote:
Hello,

i want to add a program to my desktop panel but it needs to be ran as
root when clicked... How do make a it prompt for my root password when
I click on that application from a panel? I tried putting sudo in
front of it in hopes a prompt of some sort will come up but no luck.

Regards,
- Jake

PS. If it matters, I'm running Xfce but I have Gnome installed if I
need something from gnome.

Or KDE? This may run outside KDE. I use something like this:


LAUNCH_CMD="MyCommand"

if test `id -u` -eq 0 ; then
exec $LAUNCH_CMD 2> /dev/null
else
kdesu -n -c "$LAUNCH_CMD" 2> /dev/null
fi


I send errors to /dev/null for the heck of it. Remove as needed.

--
Roger Oberholtzer

OPQ Systems / Ramböll RST

Ramböll Sverige AB
Kapellgränd 7
P.O. Box 4205
SE-102 65 Stockholm, Sweden

Tel: Int +46 8-615 60 20
Mobl: Int +46 70-815 1696

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

N‹§²æìr¸›y隊Z)z{.±ï(r)žË›±Êâmê)z{.±ê+€Z+i×b¶*'jW(šf§vǦj)h¥éí¯¿
í»­¯¿
í»¬ºÇ¾…éi¢—§²ë ¢¸
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx




Relevant Pages

  • [opensuse] Re: Running a program as root from desktop panel
    ... if you look at Roger's script he's checking to see if the current user is id ... (this is root by the way). ... It's how YaST2 is launched in the KDE desktop ... Now as you mentioned you've got GNOME available you might want to look again ...
    (SuSE)
  • Re: Running X app from script
    ... >>script automatically launch some X client. ... > ifup is run as root. ... Plus, I think Dmitry wanted to launch an IRC application, ...
    (comp.os.linux.misc)
  • Re: Automating Database Startup and Shutdown on Tru64 os V5.1A
    ... But I tryed to launch the script as root user and always it showed me permission deined; ...
    (comp.databases.oracle.server)
  • Re: Automating Database Startup and Shutdown on Tru64 os V5.1A
    ... > If you launch the script as root and you don't give the right parameters ... > and the script is run again, via rsh, with the right parameters but the ...
    (comp.databases.oracle.server)
  • KDE issues
    ... Has anyone experienced segmentation faults with kicker (kde panel)? ... to, for example, System Fonts and choosing administration level (root). ... Put the following to your /etc/rc.d/rc.local startup script. ...
    (Fedora)