org.gnome.SessionManager in Ubuntu 12.04 chroot

2019-07-08 10:08发布

问题:

I'm trying to test totem in a minimal chroot (host and chroot both ubuntu 12.04 amd64). When I load a video, I get the error

** (totem:25660): WARNING **: Problem inhibiting the screensaver: GDBus.Error:
org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist

Indeed, the screen will turn off (session idle) while watching a video. To confirm, I tested with python:

>>> import dbus
>>> bus = dbus.SessionBus()
>>> bus.get_object('org.gnome.SessionManager','/org/gnome/SessionManager')

and get the error

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.gnome.SessionManager was not provided by any .service files

Does anyone know what packages would provide the dbus interface org.gnome.SessionManager in a chroot? After searching on this, I've tried gnome-session, gnome-session-common and gnome-session-bin to no avail.

By searching on packages.ubuntu.com and on a full 12.04 system where these both work correctly, there doesn't appear to be any package providing a file named org.gnome.SessionManager.service, so what .service file is it looking for?.

回答1:

On a system where that service is working, you can find out by querying the bus like this:

$ qdbus org.freedesktop.DBus / org.freedesktop.DBus.GetNameOwner org.kde.klipper
:1.82
$ qdbus org.freedesktop.DBus / org.freedesktop.DBus.GetConnectionUnixProcessID :1.82
1441
$ readlink /proc/1441/exe
/usr/bin/kdeinit4
$ rpm -qf /usr/bin/kdeinit4           # in your case dpkg -S /path/to/program
kdelibs4-4.7.2-5.5.1.x86_64