Page 1 of 1

[SOLVED] - kdesu doesn't work

PostPosted: Apr 21st, '13, 05:55
by gohlip
I installed package 'sudo' and this works fine at user terminal (after amending /etc/sudoers).
However, to use gui apps (like kwrite or kate), command 'kdesu' does not work (I assume neither would gksu, but I don't use gnome).
Code: Select all
bash: kdesu: command not found

If I use only 'sudo' for gui, eg., I get
Code: Select all
$ sudo kwrite /boot/grub2/custom.cfg
[sudo] password for .......
No protocol specified
kwrite: cannot connect to X server :0
(but that is to be expected)

Also checked that I have kdebase4 installed.
How can I get kdesu to work? Thanks.

ps: I'm on m3b4, but I don't suppose that makes any difference (but systemd...?).

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 10:42
by doktor5000
kdesu has nothing to do with systemd, and also not with sudo.
Can't tell for cauldron, but in Mageia 2 kdesu comes with kdebase4-runtime, but the problem is it's not in $PATH.
E.g. i created a symlink to be able to use it easily:

[doktor5000@Mageia2 ~]$ ls -al /usr/bin/kdesu
lrwxrwxrwx 1 root root 29 Jan 19 18:59 /usr/bin/kdesu -> /usr/lib64/kde4/libexec/kdesu*


If you want to use sudo with GUI apps, you probably need to use sudo -E to preserve your environment variables.
This is the case since at least Mageia 1. I'm using an alias for that, works fine:
Code: Select all
[doktor5000@Mageia2 ~]$ alias sudo
alias sudo='sudo -E'

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 11:35
by gohlip
Thanks again for your response.

doktor5000 wrote:kdesu has nothing to do with systemd, and also not with sudo.
Yes, I think you're right.
doktor5000 wrote:Can't tell for cauldron, but in Mageia 2 kdesu comes with kdebase4-runtime, but the problem is it's not in $PATH.
kdebase4-runtime was also installed.
doktor5000 wrote:E.g. i created a symlink to be able to use it easily:

[doktor5000@Mageia2 ~]$ ls -al /usr/bin/kdesu
lrwxrwxrwx 1 root root 29 Jan 19 18:59 /usr/bin/kdesu -> /usr/lib64/kde4/libexec/kdesu*


If you want to use sudo with GUI apps, you probably need to use sudo -E to preserve your environment variables.
This is the case since at least Mageia 1. I'm using an alias for that, works fine:
Code: Select all
[doktor5000@Mageia2 ~]$ alias sudo
alias sudo='sudo -E'

I did the above link and alias, unfortunately, I still could not get kdesu to work.
Code: Select all
ls: cannot access /usr/bin/kdesu: No such file or directory
but alias command has no error and I assume is performed.
I then use "ln" instead of "ls" thinking it might be a typo, but same error message.

doktor5000, this is not a show-stopper (meaning it is not a big deal as I can still go to root terminal "su -" and do my things there) but I want to thank you again for your help. Having sudo alone is a great utility itself and I was hoping to use kdesu as well.
Danke.

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 13:16
by alf
to create the link use
Code: Select all
ln -s /usr/bin/kdesu /usr/lib64/kde4/libexec/kdesu

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 14:02
by gohlip
Thanks alf,
but following results...
Code: Select all
ln: failed to create symbolic link ‘/usr/lib64/kde4/libexec/kdesu’: File exists
and I still cannot kdesu :)

Googling this gives an interesting find..
http://lists.kde.org/?l=kde&m=135698471620558
> A few months ago, the last time a topic like this came up on the kde
> lists, I actually tried kdesu and kdesudo and discovered they no
> longer even worked.

but honestly, I don't know what polkit is all about. :)
I also have Chakra (with systemd) and Kubuntu and both works with kdesu (kdesudo) at installation..

Thanks everyone, and as I mentioned, there's no need to sweat this.
Cheers!

[edit] sudoedit works....but I'd rather not.

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 14:28
by tom_
try:

Code: Select all
sudo ln -s  /usr/lib64/kde4/libexec/kdesu /usr/bin/kdesu

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 14:37
by doktor5000
@gohlip: Please don't mangle everything together.

1. sudo has no relation to kdesu, so the alias "sudo -E" is only for sudo, but you mentioned it together, when trying to get kdesu to work.
2. please show the output of the following command:
Code: Select all
ls -al /usr/bin/*kdesu*

3. If you post error messages, always post them together with the command that produced them.
4. sudo alone is not enough, in a graphical desktop session one often may need kdesu/gksu.

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 15:18
by gohlip
doktor5000, here goes...
Code: Select all
$ ls -al /usr/bin/*kdesu*
ls: cannot access /usr/bin/*kdesu*: No such file or directory


Cheers!

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 15:24
by gohlip
more...to make clear.

Code: Select all
[pop@localhost ~]$ sudo kate /boot/grub2/custom.cfg
[sudo] password for pop:
No protocol specified
kate: cannot connect to X server :0
[pop@localhost ~]$ sudo mount /dev/sda5 /media/Bolt
[pop@localhost ~]$ sudo umount /media/Bolt
[pop@localhost ~]$ kdesudo kate /boot/grub2/custom.cfg
bash: kdesudo: command not found
[pop@localhost ~]$ sudo urpmq polkit
polkit
[pop@localhost ~]$ sudo urpmi polkit
Package polkit-0.107-6.mga3.x86_64 is already installed
Marking polkit as manually installed, it won't be auto-orphaned
writing /var/lib/rpm/installed-through-deps.list
[pop@localhost ~]$ kdesudo kate /boot/grub2/custom.cfg
bash: kdesudo: command not found
[pop@localhost ~]$ ls -al /usr/bin/*kdesu*
ls: cannot access /usr/bin/*kdesu*: No such file or directory
[pop@localhost ~]$ su -
Password:
[root@localhost ~]# ls -al /usr/bin/*kdesu*
ls: cannot access /usr/bin/*kdesu*: No such file or directory
[root@localhost ~]#


[edit]oops...I should use kdesu not kdesudo
Code: Select all
[pop@localhost ~]$ kdesu kate /boot/grub2/custom.cfg
bash: kdesu: command not found
[pop@localhost ~]$




thanks again.
Cheers!

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 15:45
by doktor5000
Well, your last post is totally mixed up.

1. for the first command, try again with
Code: Select all
sudo -E kate /boot/grub2/custom.cfg

2. There's no kdesudo, only kdesu - kdesu is normally used inside a KDE session to start graphical apps (like systemsettings) and it should already be working there - try Alt+F2 and enter kdesu systemsettings
3. ls only shows files/directories/links, it does not create them. Look for tom's post how to create the symlink to make kdesu available in a terminal for your user.

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 15:53
by gohlip
Code: Select all
[pop@localhost ~]$ kdesu kate /boot/grub2/custom.cfg
bash: kdesu: command not found
[pop@localhost ~]$ sudo -E kate /boot/grub2/custom.cfg
[sudo] password for pop:
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
Error: "/var/tmp/kdecache-pop" is owned by uid 1000 instead of uid 0.
kate(2457)/kdeui (kdelibs): Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)
KCrash: Application 'kate' crashing...
KCrash: Attempting to start /usr/lib64/kde4/libexec/drkonqi from kdeinit
sock_file=/home/pop/.kde4/socket-localhost/kdeinit4__0
[pop@localhost ~]$


As above, kate crashed.
Using Alt+F2 and enter kdesu systemsettings, it works.
GUI system settingss appears.
And so did "kdesu kate /boot/grub2/custom.cfg" at Alt +F2


Now, how to make this work at user terminal?

ps: doktor5000, thanks for your persistence.

Re: kdesu doesn't work

PostPosted: Apr 21st, '13, 16:16
by gohlip
Look for tom's post how to create the symlink to make kdesu available in a terminal for your user.

Missed his post in the "flurry" of quick successions of posts. Sorry Tom, missed your post altogether, and you're right spot on!
Code: Select all
$ sudo ln -s  /usr/lib64/kde4/libexec/kdesu /usr/bin/kdesu

works wonderfully!

Thanks to doktor5000, alf and Tom.
Great team! Cheers! Have a beer on me. Salute!