Wednesday, June 13, 2018

sudo - How to run GUI applications as root

UPDATE







I would like to know which is the recommend way of running GUI applications as root, mainly because what I'm trying isn't running smoothly. I get some annoying warnings that makes me think whether I'm doing something wrong or not.



I'm using gksudo and sudo -i, which I understand, are doing the same thing. Please let me know if there is some slight differences between them.



Regarding the problems I'm experiencing, I would like to start with nautilus (run as root). I can't edit the preferences file maybe because the program couldn't create its own configuration files. A warning says that the folder /root/.config/nautilus must be created. When you start an application for the first time, the program is responsible for creating the configuration files it will potentially need. So, when you are running as root, it should happen the same, shouldn't it?



Furthermore, in the shell appears some strange warnings while running this application, such as the followings:





(nautilus:3406): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
Nautilus-Share-Message: Called "net usershare info" but it failed: The "shared network" returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error It doesn't exist the file or the folder
Please ask your system administrator to enable user sharing.




Other applications like gedit or firefox complained in this way:




(gedit:3444): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files




(gedit:3444): GLib-GIO-WARNING **: Failed to parse translated string ''Monospace 12'' for key 'editor-font' in schema 'org.gnome.gedit.preferences.editor': 0:expected value



(gedit:3444): GLib-GIO-WARNING **: Using untranslated default instead.



(firefox:2719): Gtk-CRITICAL **: IA__gtk_clipboard_set_with_data: assertion 'targets != NULL




I want to make a clean install of the system soon, but before that, I would like to understand how it works in case I need this stuff in the future for specific things. Though I know it's safer to use the straight sudo in the command line instead.




Why this is happening? Thanks in advance

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...