Results 1 to 4 of 4
If this is the wrong place to ask, just move it. So many categories
So, I'm writing a program that needs root-privileges to run properly. I made a .desktop file ...
- 02-09-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 2
gksu, kdesu, gnomesu, gksudo, ...
If this is the wrong place to ask, just move it. So many categories

So, I'm writing a program that needs root-privileges to run properly. I made a .desktop file that sits in /usr/share/applications. I'm running Ubuntu Gutsy and Mandriva 2008, so in Ubuntu I use as a starter:
gksu /usr/bin/xmple
and under Mandriva I use:
kdesu /usr/bin/xmple
But Kubuntu also needs kdesu, but the Mandriva package won't work under Kubuntu, so I need 2 Ubuntu packages. One for Gnome and one for KDE.
Isn't there a general term to call root in Linux, one that doesn't depend on which distro or desktop envirement you use?
- 02-09-2008 #2Linux Newbie
- Join Date
- Jan 2008
- Location
- UK
- Posts
- 211
maybe I do not quite understand but if your program just needs root privileges, and not kde or gnome can you not use a script to execute and use su in the script, or write a script that checks what system it is on and then executes the appropriate command.
- 02-10-2008 #3
If you need root privileges, I would recommend forcing this onto the user. You can do something like the following:
You could instruct the user on how to do this (sudo / su), or instruct them on how to set the suid bit.Code:if(geteuid() != 0) fputs("I have to be run as root!\n", stderr);DISTRO=Arch
Registered Linux User #388732
- 02-11-2008 #4Just Joined!
- Join Date
- Feb 2008
- Posts
- 2
Well, if I have to do it with a script, then it has to be done before installation, right? Because I made packages (deb,rpm) and they put the .desktop file in place, so it wouldn't matter anymore if I run a script at startup of the program.
I wonder how other programs do this kind of stuff, but I didn't find an example yet.


Reply With Quote