Launcher requiring root doesn't work

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ScottyD
Level 2
Level 2
Posts: 51
Joined: Thu Oct 20, 2011 5:16 pm

Launcher requiring root doesn't work

Post by ScottyD »

I have a few gui's that require root access.

If I put "gksudo application " as the command text nothing visible happens.
If I type it on the command-line the application launches as expected with a root login window.

??????
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18228
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Launcher requiring root doesn't work

Post by karlchen »

Hello, ScottyD.
  • You might like to be more precise. What exactly does application stand for? I mean it has got a real name, this executable file. At least here there is no executable file named application.
  • What exactly did you put in the commandline of the menu item or of the desktop launcher which you created? "gksudo application" including the double quotes? If so this is almost guaranteed not to work and fail silently. If I enter "gksudo application" including the double quotes in the commandline, the shell will silently return to the prompt without displaying any error message.
  • Does application include a fully qualified pathname? If not then this could be the problem, too. Unless application can be found following the $PATH variable, gksudo may simply not be able to launch application, because the shell cannot find it.
    However, when you launch it in a terminal, gksudo application, you might by pure accident be in the right folder and your $PATH variable might by pure accident include the dot (=current working folder) as a component.
Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
ScottyD
Level 2
Level 2
Posts: 51
Joined: Thu Oct 20, 2011 5:16 pm

Re: Launcher requiring root doesn't work

Post by ScottyD »

Ok, lets be bold, "1" of the applications that will not run in a launcher prefixed by gksudo is backintime-qt4, but has no problem on the command line.

Now interesting your suggestion about the path got me to look at the non-root version which has a launcher with just "backintime-qt4", and yes the quotes were to delineate what the command was, not what was in the command text itself, Back to the interesting point, it runs fine not prefixed with gksudo, but fails when prefixed with gksudo in a launcher! and gksudo on the command line succeeds...

So maybe the root account has an incomplete PATH? putting /usr/bin/backintime-qt4 in the command text now succeeds. But it does have the artifact of opening a terminal and it hangs around while the root version is running. The non-root, or sans gksudo variant does not bring up a terminal? inconsistencies abound.

Scott
Monsta
Level 10
Level 10
Posts: 3071
Joined: Fri Aug 19, 2011 3:46 am

Re: Launcher requiring root doesn't work

Post by Monsta »

Try this:

Code: Select all

su-to-root -X -c application_name
This is used in the menu entries of several apps, like gsmartcontrol and gtkorphan.
ScottyD
Level 2
Level 2
Posts: 51
Joined: Thu Oct 20, 2011 5:16 pm

Re: Launcher requiring root doesn't work

Post by ScottyD »

thanks!
Locked

Return to “MATE”