Results 1 to 9 of 9

Thread: KDE kdesu can launch app from console but not from Panel icon?

  1. #1

    Question KDE kdesu can launch app from console but not from Panel icon?

    Hello,

    I have an app that I launch with root privs using 'kdesu'.

    If I launch it from shell when I'm logged in as a normal user,

    Code:
        kdesu -d -c "/opt/phpstorm/bin/phpstorm.sh" %f
    it works perfectly.

    But if I set up a Plasma panel icon with

    Code:
    Properties:
        Application:
            Command"
                kdesu -d -c "/opt/phpstorm/bin/phpstorm.sh" %f
    when I click to launch it it tries to start then quites. The system logs show

    Code:
        Jul 13 18:16:09 jedi.mylan sudo[11259]:  yoda : TTY=pts/4 ; PWD=/home/yoda ; USER=root ; COMMAND=/usr/lib64/libexec/kf5/kdesu_stub -
        Jul 13 18:16:09 jedi.mylan sudo[11259]: pam_unix(sudo:session): session opened for user root by (uid=0)
        Jul 13 18:16:09 jedi.mylan sudo[11259]: pam_systemd(sudo:session): Cannot create session: Already running in a session
        Jul 13 18:16:09 jedi.mylan sudo[11262]:  yoda : TTY=pts/5 ; PWD=/home/yoda ; USER=root ; COMMAND=/usr/lib64/libexec/kf5/kdesu_stub -
        Jul 13 18:16:09 jedi.mylan sudo[11262]: pam_unix(sudo:session): session opened for user root by (uid=0)
        Jul 13 18:16:09 jedi.mylan sudo[11262]: pam_systemd(sudo:session): Cannot create session: Already running in a session
        Jul 13 18:16:12 jedi.mylan sudo[11262]: pam_unix(sudo:session): session closed for user root
        Jul 13 18:16:12 jedi.mylan sudo[11259]: pam_unix(sudo:session): session closed for user root
    What do I need to do to get it to launch OK from the icon in the Plasma panel?

    I don't know what info to provide that's helpful so please just ask.

    Thanks.

    Rob

  2. #2

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    If I chage the command in the panel icon

    Code:
    -    kdesu -c "..."
    +    xdg-su -c "..."
    it works okay.

    So it looks like the problem isn't with sudo rights in general.

    Instead something specific to kdesu?

  3. #3

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    Quote Originally Posted by robgane View Post
    Instead something specific to kdesu?
    Well, yes, you probably used incorrect options.

    Leave out the %f and it should work. %f will be expanded to all selected files in a file manager (doesn't happen in the terminal of course).

    The -c is not really necessary either for kdesu, and you don't need quotes as there are no spaces.
    Actually this would be enough:
    Code:
    kdesu /opt/phpstorm/bin/phpstorm.sh

  4. #4

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    Removing the %f makes absolutely no difference. Same behavior as I reported with or without the %f.

  5. #5

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    Quote Originally Posted by robgane View Post
    Removing the %f makes absolutely no difference. Same behavior as I reported with or without the %f.
    But it's still wrong and shouldn't be there.

    And does "kdesu /opt/phpstorm/bin/phpstorm.sh" alone work? (without the quotes)

    Btw, xdg-su also just uses kdesu in a KDE session.
    Last edited by wolfi323; 14-Jul-2017 at 11:15.

  6. #6

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    Code:
    kdesu /opt/phpstorm/bin/phpstorm.sh
    kdesu "/opt/phpstorm/bin/phpstorm.sh"
    kdesu -c "/opt/phpstorm/bin/phpstorm.sh"
    etc
    all fail exactly as I reported.

    Using xdg-su works in all cases.

  7. #7
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,149
    Blog Entries
    2

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    In your original post,
    Your logfile shows that you already have root permissions when you invoked "kdesu" which is what is causing the problem.

    Although you're pointing to your yoda (home?) directory, are you logged in as root?
    <Something> is causing your command to run with elevated permissions, perhaps it's a tick-box in the Panel's properties to run your command as root?

    You need to be a normal User when you invoke "kdesu"

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  8. #8

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    > Although you're pointing to your yoda (home?) directory, are you logged in as root?

    no

    > <Something> is causing your command to run with elevated permissions

    Hm. I see that :-/

    > perhaps it's a tick-box in the Panel's properties to run your command as root?

    Nope, I checked.

    > You need to be a normal User when you invoke "kdesu"

    I know. That's the point of it. An I'm logged in as my normal user, yoda. On yoda's desktop, I click the Panel icon there. "As" myself.

    And just to repeat, I have NO problems with ANY 'kdesu whatever' command if I launch is from Konsole, as myself. Only from the Panel icon launcher.

  9. #9

    Default Re: KDE kdesu can launch app from console but not from Panel icon?

    Quote Originally Posted by robgane View Post
    Using xdg-su works in all cases.
    Then use that.
    In the end it should just run kdesu anyway as mentioned.

    OTOH, you can just tick the mentioned "Run as different user" option in "Advanced", and you don't need to use xdg-su or kdesu at all.

    Using kdesu in the command field does work fine here though, I just tried it with a panel icon applet.

    Maybe the full content of the icon's .desktop file would give a clue what's wrong (I doubt it's a problem with kdesu itself if it works from a terminal window), you should be able to find it in ~/.local/share/plasma_icons/.
    Last edited by wolfi323; 14-Jul-2017 at 14:55.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •