Re: Requiring systemd for the gnome-settings-daemon power plugin



On Wed, Oct 24, 2012 at 4:11 AM, Bastien Nocera <hadess hadess net> wrote:

>
> You still haven't answered why it's important to keep ConsoleKit. We're
> giving 6 months headway to people that'll need to replace it, which,
> from your code, should fairly trivial.
>

I've spent 30 minutes looking into this, this morning. I've attached
the logind D-Bus apis that I found being used in gnome-session,
gnome-shell and gnome-settings-daemon. That looks easy enough, but
there's some complications:

- The shell assumes that the object path for the current session
object is /org/freedesktop/login1/session/ + getenv
("XDG_SESSION_ID"), I'm sure there's other assumptions like this
elsewhere

- We expect PrepareForSleep to be emitted before and after
suspend/resume, which is hard to do, as we learned in upower

- The inhibit api is using a mix of D-Bus with fd passing and an fd-based api

- The session state api used in GnomeSettingsSession is not using
D-Bus, but a library api which is based upon various filesystem
interfaces (/sys/fs/cgroup/systemd, /run/systemd/, plus an fd-based
api for notification. The actual api we're using is minimal:
  sd_login_monitor_new
  sd_login_monitor_get_fd
  sd_login_monitor_flush
  sd_session_is_active


Is it possible to reimplement this all compatibly inside ConsoleKit ?
Probably. But 'fairly trivial', I'm not so sure about.
<?xml version="1.0" encoding="UTF-8"?>
<node name="/org/freedesktop/login1/Manager"
  xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd";
>

  <interface name="org.freedesktop.login1.Manager">
    <method name="GetSession">
      <arg name="session_id" type="s" direction="in"/>
      <arg name="object_path" type="o" direction="out"/>
    </method>
    <method name="Reboot">
      <arg name="allow_interaction" type="b" direction="in"/>
    </method>
    <method name="PowerOff">
      <arg name="allow_interaction" type="b" direction="in"/>
    </method>
    <method name="Suspend">
      <arg name="allow_interaction" type="b" direction="in"/>
    </method>
    <method name="Hibernate">
      <arg name="allow_interaction" type="b" direction="in"/>
    </method>
    <method name="CanReboot">
      <arg name="result" type="s" direction="out"/>
    </method>
    <method name="CanPowerOff">
      <arg name="result" type="s" direction="out"/>
    </method>
    <method name="CanSuspend">
      <arg name="result" type="s" direction="out"/>
    </method>
    <method name="CanHibernate">
      <arg name="result" type="s" direction="out"/>
    </method>
    <method name="Inhibit">
      <arg name="what" type="s" direction="in"/>
      <arg name="who" type="s" direction="in"/>
      <arg name="why" type="s" direction="in"/>
      <arg name="type" type="s" direction="in"/>
      <arg name="fd_index" type="i" direction="out"/>
    </method>
    <method name="SetIdleHint">
      <arg name="is_idle" type="b" direction="in"/>
    </method>
    <signal name="PrepareForSleep">
      <arg name="about_to_suspend" type="b" direction="out"/>
    </signal>
  </interface>
  <interface name="org.freedesktop.login1.Session">
    <signal name="Lock"/>
    <signal name="Unlock"/>
  </interface>
</node>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]