Can't launch editor as root

OS 11.1 KDE 4.2. I am trying to edit some configuration files, and I am
finding that I cannot pull up a text editor (kwrite or kate) if I in
root. The only way I can open one up with root privileges is via

kdesu kate/kwrite

I could access kate as root in 10.3, so not sure why this is happening
here. Browsed through KDE settings and Yast, but couldn’t find any
obvious settings.

Any advice appreciated.


mazibuko

mazibuko’s Profile: http://forums.opensuse.org/member.php?userid=19605
View this thread: http://forums.opensuse.org/showthread.php?t=407723

If you browse to the file with “File Manager - Super User Mode,”
right-click on the filename and select “Open with KWrite,” does that
work? From your question, I assume that you’re in a Konsole (or
equivalent) at a command-line interface, logged in as root (“su”) and
that you manually enter “kwrite [filename]” in the terminal.

If not, and I’ve got it backwards (not unusual for me), try it that way
and see what happens.


smpoole7

smpoole7’s Profile: http://forums.opensuse.org/member.php?userid=13513
View this thread: http://forums.opensuse.org/showthread.php?t=407723

Hi, thanks for the suggestion. I was actually in a konsole as root and
entering kwrite manually.

I tried what you suggested (entered dolphin as super-user), but when I
tried to open the file I wanted, it gave me:

KDEInit could not launch ‘/usr/bin/kwrite’

So, no joy there either. My workaround at the moment is to open kwrite
with kdesu, and then open the files I need through kwrites menus.
Clunky, but it’s all I have at the moment.

Will welcome any further suggestions.

Thanks!


mazibuko

mazibuko’s Profile: http://forums.opensuse.org/member.php?userid=19605
View this thread: http://forums.opensuse.org/showthread.php?t=407723

Two other suggestions, actually.

  1. In your Konsole, before you su to root, enter “which kwrite” to get
    the path. Then su to root and enter that full path. See if you get an
    error message. If it starts up and runs, there you go.

1-1/2. You can also try an “echo $PATH” to see if /usr/bin (if that’s
where kwrite is at) is in your path, but I can’t imagine that it
wouldn’t be. I can’t see how your system would even be usable if it
wasn’t.

  1. Try restarting. When I was using KDE 4.1, I’d get weird problems
    like this from time to time. A restart might help. Not to depress you,
    but this is one reason why I backed off of KDE 4. I was tired of crap
    like this. (And losing my taskbar or KMenu for no apparent reason. And
    then losing my sound and never getting it back. And … you get the
    idea.)

Finally (OK, this is a third suggestion), it’d be a lot of work and a
pain, but you could revert back to KDE 3.59 until they get all the bugs
worked out of KDE 4. I personally don’t think it’s ready for prime time
yet.


smpoole7

smpoole7’s Profile: http://forums.opensuse.org/member.php?userid=13513
View this thread: http://forums.opensuse.org/showthread.php?t=407723

…or you could install and use a relatively user-firendly CLI text
editor like nano or pico instead.


deano_ferrari

deano_ferrari’s Profile: http://forums.opensuse.org/member.php?userid=122
View this thread: http://forums.opensuse.org/showthread.php?t=407723

deano_ferrari;1943768 Wrote:
> …or you could install and use a relatively user-firendly CLI text
> editor like nano or pico instead.

That’s an idea. I use nano when I have to go into a machine remotely
with ssh. But to be honest, it’s still clunky compared to KWrite, which
has things like multiple find and replace, and easy cut and paste.


smpoole7

smpoole7’s Profile: http://forums.opensuse.org/member.php?userid=13513
View this thread: http://forums.opensuse.org/showthread.php?t=407723

Thanks for the suggestions.

Kwrite is in /usr/bin, which is in the path.

I still get the problem, after restarting as before. No error message,
but terminal just hangs after entering kwrite as root (with or without
full path).

I must say, besides this and maybe a few other small problems (my sound
card shuts off at times until an app needs to make a sound, then it pops
back on and makes the sound, then goes dead again, but I digress), I
have found KDE 4 (I am at 4.2 now) pretty good. It works better with my
laptop, although, to be fair, that might simply be improvements between
10.3 and 11.1, rather than the newer KDE. Anyway, I am afraid I am
stuck with 4.2 for now, because I am spending too much time organizing
the system (not bugs, necessarily, but installing apps and suchlike),
rather than actually doing work!

Pardon the meandering above, but any further ideas most welcome, and
thanks very much for help thus far.


mazibuko

mazibuko’s Profile: http://forums.opensuse.org/member.php?userid=19605
View this thread: http://forums.opensuse.org/showthread.php?t=407723

in a terminal

su -
password

konqueror

(will open k as root - replace application name as required eg:
dolphin)


Box: Linux 2.6.27.12-170.2.5 i686 | Fedora 10 | Gnome 2.24.2 | M2N4-SLI
| AMD 64 X2 5200+ | nVidia 8500GT | 2GB RAM
Lap: openSUSE 11.1 | Celeron 550 | (KDE4.2.0)“94” | Intel 965 GM |
Lenovo R61e | 3GB RAM

caf4926’s Profile: http://forums.opensuse.org/member.php?userid=204
View this thread: http://forums.opensuse.org/showthread.php?t=407723

Hi,
Thanks for the suggestion. Terminal also hangs when I try launching
either konqueror or dolphin from root. I suppose this will apply to all
applications. I wonder if there is some sort of conflict with happening
because KDE wants to launch gui password prompt because it is going into
super user mode.

Just to add some more information about the problem, sudo doesn’t
appear to work either:

Code:

user@linux-48ic:~> sudo kwrite
root’s password:
kwrite: cannot connect to X server
user@linux-48ic:~> sudo dolphin
<unknown program name>(6927)/: KUniqueApplication: Cannot find the D-Bus session server

<unknown program name>(6926)/: KUniqueApplication: Pipe closed unexpectedly.

Perhaps these problems are linked?


mazibuko

mazibuko’s Profile: http://forums.opensuse.org/member.php?userid=19605
View this thread: http://forums.opensuse.org/showthread.php?t=407723

but did you try

su -
password

not the same as sudo


Box: Linux 2.6.27.12-170.2.5 i686 | Fedora 10 | Gnome 2.24.2 | M2N4-SLI
| AMD 64 X2 5200+ | nVidia 8500GT | 2GB RAM
Lap: openSUSE 11.1 | Celeron 550 | (KDE4.2.0)“94” | Intel 965 GM |
Lenovo R61e | 3GB RAM

caf4926’s Profile: http://forums.opensuse.org/member.php?userid=204
View this thread: http://forums.opensuse.org/showthread.php?t=407723

Yes, I did,sorry for not making it clearer. Terminal hangs when I do
that.

Code:

user@linux-48ic:~> su
Password:
linux-48ic:/home/user # dolphin
(hanging cursor here, no prompt)


mazibuko

mazibuko’s Profile: http://forums.opensuse.org/member.php?userid=19605
View this thread: http://forums.opensuse.org/showthread.php?t=407723

please notice

su - (do you see the space and then the -


Box: Linux 2.6.27.12-170.2.5 i686 | Fedora 10 | Gnome 2.24.2 | M2N4-SLI
| AMD 64 X2 5200+ | nVidia 8500GT | 2GB RAM
Lap: openSUSE 11.1 | Celeron 550 | (KDE4.2.0)“94” | Intel 965 GM |
Lenovo R61e | 3GB RAM

caf4926’s Profile: http://forums.opensuse.org/member.php?userid=204
View this thread: http://forums.opensuse.org/showthread.php?t=407723

No, I hadn’t, sorry.

And it works, actually, for Dolphin and Kwrite.

Not sure exactly what or why that extra hyphen works, but it did, so
thank you!


mazibuko

mazibuko’s Profile: http://forums.opensuse.org/member.php?userid=19605
View this thread: http://forums.opensuse.org/showthread.php?t=407723

mazibuko wrote:
> OS 11.1 KDE 4.2. I am trying to edit some configuration files, and I am
> finding that I cannot pull up a text editor (kwrite or kate) if I in
> root.

what do you mean by that? for example, how do you become root?
that is, do you log into KDE (or GNOME) as root, then open a
terminal/console and can’t launch kate?

or what? (hopefully you say that you log in as a regular user and
THEN become root in a terminal by (for example) typing “su -” and
entering the root password…)

i ask, because you should NEVER log into KDE (etc) as root–never EVER!

doing so can be the cause of many strange problems…just like the
one you have now…or, the next time you log in as yourself you find
you can no longer do some things…


have fun

The most likely cause of your problem is that the user you are logged in
as has explicit authority over the current XSession and as such kate
running as root has no way to connect to the current session owned by
the user.
Instead of using su, sudo instead use kdesu so to launch kate it would
be:
kdesu kate


silenuz

silenuz’s Profile: http://forums.opensuse.org/member.php?userid=19071
View this thread: http://forums.opensuse.org/showthread.php?t=407723

opensuse 11.0

i know about this problem since kde 4.1.x still going on in 4.2. It
must have to with right’s mgmt, because all works, if you logged in as
root. The only thing that i saw was the fact, that the process
kwrite/kate still is running and that a second try will also start a
second hanging process :frowning:

There is no work around like console in su mode and konqueror/kwrite
start. i also had to change to nano


gorgonz

gorgonz’s Profile: http://forums.opensuse.org/member.php?userid=11356
View this thread: http://forums.opensuse.org/showthread.php?t=407723

i remember something else, that worked for me: used konqueror-kde3 in
su-mode. This worked flawlessly


gorgonz

gorgonz’s Profile: http://forums.opensuse.org/member.php?userid=11356
View this thread: http://forums.opensuse.org/showthread.php?t=407723