Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
meraj@meraj-SATELLITE-C850-A785:~$ sudo gedit /etc/php5/apache2/php.ini

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

whenever I save the file in gedit it is not saved what should I do?

I have ubuntu 14.04

share|improve this question
    
Hm, does it happen, when you don't invoke sudo? I suppose, it might have to do with user switching. AFAIK, you shouldn't use sudo for graphical applications, use gksudo instead. Here's almost exact answer to your question: askubuntu.com/questions/270006/… –  Bob Aug 17 at 14:53
    
Sorry, but problem exist. Thanks for support meraj@meraj-SATELLITE-C850-A785:/var/www/html$ gksudo gedit meraj.php (gedit:17472): 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:17472): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files meraj@meraj-SATELLITE-C850-A785:/var/www/html$ –  M A SIDDIQUI Aug 17 at 15:13
    
Hm. Did you manually tweak your graphical environment? (installed/removed something)? Do you have Gnome 3 installed or something else? –  Bob Aug 17 at 15:22
    
One more thing. Do those Gtk-WARNINGs prevent you from saving your file? I thought, they shouldn't be critical - usually it curses, but works. –  Bob Aug 17 at 15:30

1 Answer 1

What to do?

You shouldn't use sudo for graphical applications, such as gedit. Use gksudo instead.

What's causing the error

I'm not sure. Apparently, the reason of error you get is that gedit is trying to invoke SessionManager's Inhibit method via D-bus.

If normal applications can connect to dbus, they should have some config files in /usr/share/dbus-1. I expected them to be /usr/share/dbus-1/services/org.gnome.SessionManager.service or /usr/share/dbus-1/system-services/org.gnome.SessionManager.service. On my Debian machine I can't find any of them.

So, my guess is gnome-session doesn't need a dbus .session file as it's not a normal application. In fact, it is itself responsible for starting the per-session instance of dbus. But the per-session instance of dbus is in fact per-user per-session, so it can't interact with graphical application running under different user than you (and root user, running sudo gedit, is different than you).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.