LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-22-2009, 05:32 PM   #1
gnreeke
LQ Newbie
 
Registered: Mar 2009
Distribution: Redhat & Centos
Posts: 4

Rep: Reputation: 0
gnome launcher won't run a sudo command directly or via a script


I'm using RedHat EL 5.3 64-bit with gnome-panel 2.16.1 etc.
I want to make a panel launcher that runs a program that
needs sudo. I have the appropriate entry in sudoers.
It is set for NOPASSWD. It is not running anything as root.
Lets say the command I need is "sudo -u somebody -H -b /usr/bin/mypgm"
If I run this from a command line, it works.
If I make an alias in my .cshrc and run the alias, it works.
If I make a gnome launcher and put this command in it,
and call it an app, it does nothing. If I call it a terminal
app, a terminal window blinks for an instant and then nothing
happens. If I make a script I own to run this command, and
run the script from the launcher, same thing. If I make a
script in /usr/local/bin owned by user "somebody" to run this
command, and run that script from the command line, it works.
If I run that script from the launcher, nothing happens.
I searched these forums and there are lots of notes about
using "gksudo" or some similar name instead of just "sudo"
to run a sudo command from a gnome desktop, but none of these
programs exist in my RedHat system. Can somebody tell me if
I really need this "gksudo" thing and why the launcher won't
just run a command that a command window will run, or other
suggestions what I am doing wrong. (I tried various things
like trying to get the script to write to a log file (echos
do get written there, so permissions are OK), making sure the
/usr/local/bin script sets all the needed environment variables,
etc; I'm pretty sure these things are not the problem.)
Thanks,
George Reeke
 
Old 06-23-2009, 10:44 AM   #2
gnreeke
LQ Newbie
 
Registered: Mar 2009
Distribution: Redhat & Centos
Posts: 4

Original Poster
Rep: Reputation: 0
I would like to add a detail to my earlier post.
With one small change in what I described before (making the
script in /usr/local/bin owned by root.root but still with
permissions 755), the setup described above works on my
CentOS 4 (clone of RedHat 4) installation on another machine,
but not on my RedHat 5 installation on my laptop. It seems
RedHat changed something between EL 4 and EL 5 that prevents
gnome launchers from running sudo commands. Anybody know what
that change was and how to undo it?
Also, as far as I can see googling gksudo, this is a graphical
version of sudo and using it (which I don't have) instead of
sudo should not make any difference as far as permissions go.
Thanks for any insight,
George Reeke
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gnome launcher for intellij shell script loopyzort Linux - Software 1 08-24-2009 12:46 PM
Running a command from a launcher (on gnome desktop) Virtuality Linux - Newbie 1 12-17-2007 08:32 AM
gnome-terminal launcher script Mur Linux - Software 0 04-26-2004 10:43 AM
launching mozilla with the run command or applicaton launcher allohakdan Linux - Newbie 2 11-19-2003 07:51 PM
How to run shell script directly without inquiring running mode? Piero Linux - Software 3 09-03-2003 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration