You are not logged in.

#1 2009-08-14 17:16:44

AtlanticVoyager
Member
Registered: 2009-08-11
Posts: 23

Errors when using "gedit" to edit a file as root

Hi. I am new to this distribution, and like what I see, but still have a few problems to iron out. I have installed the GNOME desktop. Things are not running completely smoothly there. One problem is that when I try to "gedit" a file as root, the terminal fills up with endless repetitions of the following text:

GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)

Finally it stops and lets me gedit and save the amended file.

Hidden among all this verbage is this:

(gedit:3086): GVFS-RemoteVolumeMonitor-WARNING **: cannot connect to the session bus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

This only happens when I "gedit" a file as root. When I "gedit" a file in my home directory as a normal user, I don't get any problems. Should I be using sudo? I don't want to, I think it is much better from a security point of view to have a separate root password, which is  only used for administrative purposes. I don't know why this error is occurring. Could someone please help?

Offline

#2 2009-08-14 21:05:15

Nathan
Member
Registered: 2008-12-27
Posts: 34

Re: Errors when using "gedit" to edit a file as root

I don't have any idea why that is happening, but you can set sudo to require a root password when you use it. I'm sure that would work.

Last edited by Nathan (2009-08-14 21:05:41)

Offline

#3 2009-08-14 22:49:58

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: Errors when using "gedit" to edit a file as root

"This only happens when I "gedit" a file as root. When I "gedit" a file in my home directory as a normal user, I don't get any problems." -> I think it's true, it's really better to act in your home directory as that user.

Offline

#4 2009-08-14 23:07:11

Arisna
Member
Registered: 2009-02-13
Posts: 81

Re: Errors when using "gedit" to edit a file as root

Try calling it with sudo, or better yet gksudo.  Using sudo with a graphical editor to work on configuration files is okay, but it would probably be worth your while to become comfortable with a console editor so that you can avoid this whole issue.  As a bonus, you'll be able to work on broken systems/systems without X11 available.  Give nano a whirl and I think you'll quickly start to find it more convenient than gedit, at least for administration.  Your choice, of course, but I think console editors are the way most Archers do it.

Offline

#5 2009-08-15 05:07:41

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: Errors when using "gedit" to edit a file as root

So the reason you cannot start it up is probably the following. Note that I assume you do an su, and not that you're logged into your X session as root. I'm explaining this for three reasons: 1. I think it's cool to know things. 2. I want to know if I'm wrong and expect people to correct me. 3. It should help you understand the system just a small bit more, which can always help with problems.

The idea behind dbus is that programs need to talk to each other to let each other know what's going on, or to send information across the system in some set, unified way. To fulfill this need was dbus. That's the long and the short of that. However, normally there are two buses running, the system bus and the session bus. The system bus (as implied by the name) is for information that is user-inspecific and (I believe) used for applications that are not running as part of the user's environment. The session bus is for items run/used during the users' sessions. So, when you log in (or some time around there, I think), the dbus session starts and it puts a lockfile (or two...really however many displays you have is how many) in ~/.dbus/session-bus/. It then uses that lockfile to communicate info in its ways.

The key thing for this problem is that the session bus starts when you login as the user, but since you (presumably) never logged in as root, it gave you the error, and also the crazy long wait time.

Offline

#6 2009-08-15 05:09:33

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: Errors when using "gedit" to edit a file as root

Offline

#7 2009-08-15 08:33:40

AtlanticVoyager
Member
Registered: 2009-08-11
Posts: 23

Re: Errors when using "gedit" to edit a file as root

....................... which goes back at least to the 10th October last year! Is this tardiness patching it in part because the developers want us to use "sudo" or "gksudo" by any chance? I haven't installed "sudo" yet, and I don't really want to go down that road, although I have read what is said in the wiki about being able to use the root password with "sudo". I really can't see the advantages of using sudo on a single user home system. Using it is more time consuming, having to remember to type "sudo" or "gksudo" at every line, sometimes forgetting and having to redo the line. Clumsy!

Incidentally this problem does not occur if you use "su -" instead of "su", so I can use "su -" for now. As I understand it using "su -" is more dangerous than using "su", because you become "proper root" and can execute all commands. Am I wrong about this? When should I NOT use "su -"?

it would probably be worth your while to become comfortable with a console editor so that you can avoid this whole issue.  As a bonus, you'll be able to work on broken systems/systems without X11 available.  Give nano a whirl and I think you'll quickly start to find it more convenient than gedit, at least for administration.

........................ Yes I use nano regularly, but the gui method is much quicker if you want to edit small sections of a large file on the fly. With the gui you can go to it directly, point, click and edit, click save and go. Maybe for me "mc" - Midnight Commander - is the way to go. There you can point and click in a terminal when you use its onboard editor: "mcedit". I would like to get to know that ncurses program better. It seems to have the best of both worlds. Do any of you have any thoughts about that?

Offline

#8 2009-08-15 09:00:17

sHyLoCk
Member
From: /dev/null
Registered: 2009-06-19
Posts: 1,197

Re: Errors when using "gedit" to edit a file as root

I can't open kwrite or kate as root either, but if I use "sux" instead of "su" i can. Sux is a wrapper  around su which will transfer the X creden tials


~ Regards,
sHy
ArchBang: Yet another Distro for Allan to break.
Blog | GIT | Forum (。◕‿◕。)

Offline

#9 2009-08-15 15:19:18

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Errors when using "gedit" to edit a file as root

The only difference between "su" and "su -" is that the hyphen tells su to open a login shell, as if root had logged in from the console.  su by itself runs an "ordinary" shell.  The principal difference is that a login shell reads your .bash_profile script when it starts, but a non-login shell reads .bashrc (assuming, of course, we're using bash).  There's no difference between permissions.  See su(1), bash(1).

Last edited by Trent (2009-08-15 15:21:15)

Offline

#10 2009-08-15 20:19:15

AtlanticVoyager
Member
Registered: 2009-08-11
Posts: 23

Re: Errors when using "gedit" to edit a file as root

This gconf bug also has affects the ability to shutdown in a straightforward way.
If I have been using a terminal with "su" and then "gedit" a file a file, then later when I want to shutdown or reboot, I cannot do this in one smooth operation. I am taken to the login screen and have to shutdown or reboot from there.
Then there are two attempts at terminating gdm, both of which fail before the system forces a quit.

If, however, I have used "su -" to "gedit" a file, then there are no hold-ups on the way to shutdown or reboot and everything proceeds as it should.

I have checked these two scenarios many times to observe that there is a definite causal link here.

Last edited by AtlanticVoyager (2009-08-15 20:20:30)

Offline

Board footer

Powered by FluxBB