···11+<?xml version="1.0" encoding="UTF-8"?>
22+<protocol name="session_core_v1" version="1">
33+ <object name="session_core_manager" version="1">
44+ <description summary="session observer">
55+ Unprivileged read-only interface for observing active sessions.
66+ </description>
77+ <s2c name="session_added">
88+ <description summary="a new session was created">
99+ Broadcast to all connected clients when any session is created. Sent
1010+ once for each already-active session when the manager is first created.
1111+ </description>
1212+ <arg name="session_id" type="uint" summary="new session identifier"/>
1313+ </s2c>
1414+ <s2c name="done">
1515+ <description summary="initial field dump complete"/>
1616+ </s2c>
1717+ <s2c name="error">
1818+ <description summary="last operation failed"/>
1919+ <arg name="code" type="enum" interface="error_code" summary="error kind"/>
2020+ <arg name="message" type="varchar" summary="human-readable error detail"/>
2121+ </s2c>
2222+ <c2s name="get_session">
2323+ <description summary="create a per-session info object">
2424+ Creates a `session_core_session` object for the given session_id.
2525+ The daemon immediately pushes all fields, followed by done.
2626+ If the session does not exist, destroyed is sent instead.
2727+ </description>
2828+ <arg name="session_id" type="uint" summary="session to query"/>
2929+ <returns iface="session_core_session"/>
3030+ </c2s>
3131+ <c2s name="get_session_by_pid">
3232+ <description summary="create a per-session info object by leader PID">
3333+ Creates a session_core_session object for the session whose leader
3434+ PID matches the given pid. The daemon immediately pushes all fields,
3535+ followed by done. If no matching session exists, destroyed is sent instead.
3636+ </description>
3737+ <arg name="pid" type="uint" summary="leader PID of the session to query"/>
3838+ <returns iface="session_core_session"/>
3939+ </c2s>
4040+ <c2s name="get_session_by_uid">
4141+ <description summary="create a per-session info object by user ID">
4242+ Creates a session_core_session object for the session whose user ID
4343+ matches the given uid. The daemon immediately pushes all fields,
4444+ followed by done. If no matching session exists, destroyed is sent instead.
4545+ </description>
4646+ <arg name="uid" type="uint" summary="user ID of the session to query"/>
4747+ <returns iface="session_core_session"/>
4848+ </c2s>
4949+ <c2s name="get_user">
5050+ <description summary="create a per-user info object">
5151+ Creates a session_core_user object for the given uid. The daemon
5252+ immediately pushes all fields, followed by done. If uid does not
5353+ correspond to a known user, not_found is sent instead.
5454+ </description>
5555+ <arg name="uid" type="uint" summary="user ID to query"/>
5656+ <returns iface="session_core_user"/>
5757+ </c2s>
5858+ <c2s name="get_seat">
5959+ <description summary="create a per-seat info object">
6060+ Creates a session_core_seat object for the seat with the given name.
6161+ The daemon immediately pushes the seat fields, followed by done, and
6262+ re-sends fields as they change. If no matching seat exists, destroyed
6363+ is sent instead.
6464+ </description>
6565+ <arg name="seat" type="varchar" summary="seat name to query"/>
6666+ <returns iface="session_core_seat"/>
6767+ </c2s>
6868+ <c2s name="reboot">
6969+ <description summary="reboot the system"/>
7070+ </c2s>
7171+ <c2s name="poweroff">
7272+ <description summary="power off the system"/>
7373+ </c2s>
7474+ <c2s name="suspend">
7575+ <description summary="suspend the system"/>
7676+ </c2s>
7777+ <c2s name="hibernate">
7878+ <description summary="hibernate the system"/>
7979+ </c2s>
8080+ <c2s name="destroy" destructor="true">
8181+ <description summary="destroy this object"/>
8282+ </c2s>
8383+ <s2c name="can_control_power">
8484+ <description summary="client may run power operations">
8585+ Non-zero if this client can reboot, power off, suspend, or hibernate
8686+ without first closing other users' sessions.
8787+ </description>
8888+ <arg name="can_control_power" type="uint" summary="non-zero if power operations are currently allowed"/>
8989+ </s2c>
9090+ </object>
9191+ <object name="session_core_session" version="1">
9292+ <description summary="per-session information">
9393+ Provides information about a single session. All fields are pushed
9494+ immediately on creation and re-sent if they change.
9595+ </description>
9696+ <s2c name="session_id">
9797+ <arg name="session_id" type="uint" summary="session identifier"/>
9898+ </s2c>
9999+ <s2c name="uid">
100100+ <arg name="uid" type="uint" summary="user id"/>
101101+ </s2c>
102102+ <s2c name="username">
103103+ <arg name="username" type="varchar" summary="username"/>
104104+ </s2c>
105105+ <s2c name="vt">
106106+ <arg name="vt" type="uint" summary="virtual terminal number"/>
107107+ </s2c>
108108+ <s2c name="seat">
109109+ <arg name="seat" type="varchar" summary="seat name"/>
110110+ </s2c>
111111+ <s2c name="leader">
112112+ <arg name="leader" type="uint" summary="PID of the session-creating process"/>
113113+ </s2c>
114114+ <s2c name="timestamp">
115115+ <arg name="timestamp" type="uint" summary="session start time (seconds since Unix epoch)"/>
116116+ </s2c>
117117+ <s2c name="is_local">
118118+ <arg name="is_local" type="uint" summary="non-zero if the session originates from the local machine, zero if remote"/>
119119+ </s2c>
120120+ <s2c name="remote_host">
121121+ <arg name="remote_host" type="varchar" summary="remote host name, empty for local sessions"/>
122122+ </s2c>
123123+ <s2c name="active">
124124+ <description summary="session active state"/>
125125+ <arg name="state" type="enum" interface="active_state" summary="session active state"/>
126126+ </s2c>
127127+ <s2c name="locked">
128128+ <description summary="session is locked"/>
129129+ </s2c>
130130+ <s2c name="unlocked">
131131+ <description summary="session is unlocked"/>
132132+ </s2c>
133133+ <s2c name="done">
134134+ <description summary="initial field dump complete"/>
135135+ </s2c>
136136+ <s2c name="destroyed">
137137+ <description summary="session has ended or did not exist">
138138+ Sent when the session is destroyed or if the `session_id` passed to
139139+ `get_session` was not found. The client should release this object.
140140+ </description>
141141+ </s2c>
142142+ <s2c name="ok">
143143+ <description summary="last operation completed successfully"/>
144144+ </s2c>
145145+ <s2c name="error">
146146+ <description summary="last operation failed"/>
147147+ <arg name="code" type="enum" interface="error_code" summary="error kind"/>
148148+ <arg name="message" type="varchar" summary="human-readable error detail"/>
149149+ </s2c>
150150+ <c2s name="lock">
151151+ <description summary="lock the session"/>
152152+ </c2s>
153153+ <c2s name="unlock">
154154+ <description summary="unlock the session"/>
155155+ </c2s>
156156+ <c2s name="terminate">
157157+ <description summary="send SIGTERM to all processes in the session"/>
158158+ </c2s>
159159+ <c2s name="kill">
160160+ <description summary="forcibly kill all processes in the session via cgroup.kill"/>
161161+ </c2s>
162162+ <c2s name="destroy" destructor="true">
163163+ <description summary="destroy this object"/>
164164+ </c2s>
165165+ <s2c name="can_modify">
166166+ <description summary="client may modify this session">
167167+ Non-zero if this client may lock, unlock, terminate, or kill this session.
168168+ </description>
169169+ <arg name="can_modify" type="uint" summary="non-zero if mutating requests are allowed"/>
170170+ </s2c>
171171+ </object>
172172+173173+ <object name="session_core_seat" version="1">
174174+ <description summary="per-seat information">
175175+ Provides information about a single seat. All fields are pushed
176176+ immediately on creation and re-sent if they change.
177177+ </description>
178178+ <s2c name="seat">
179179+ <arg name="seat" type="varchar" summary="seat name"/>
180180+ </s2c>
181181+ <s2c name="mode">
182182+ <arg name="mode" type="enum" interface="seat_mode" summary="seat mode"/>
183183+ </s2c>
184184+ <s2c name="current_vt">
185185+ <arg name="vt" type="uint" summary="current virtual terminal, 0 if none or not VT-bound"/>
186186+ </s2c>
187187+ <s2c name="client_added">
188188+ <description summary="seat client added">
189189+ Sent once per client during the initial dump and whenever a new client
190190+ joins the seat. Use get_client with this PID to retrieve
191191+ the client's status object.
192192+ </description>
193193+ <arg name="pid" type="uint" summary="PID of the client that opened the seat"/>
194194+ </s2c>
195195+ <c2s name="get_client">
196196+ <description summary="create a per-seat-client info object">
197197+ Creates a session_core_seat_client object for the client with the given PID
198198+ on this seat. The daemon immediately pushes the client fields, followed by
199199+ done, and re-sends fields as they change. If no matching client exists,
200200+ destroyed is sent instead.
201201+ </description>
202202+ <arg name="pid" type="uint" summary="PID of the client that opened the seat"/>
203203+ <returns iface="session_core_seat_client"/>
204204+ </c2s>
205205+ <c2s name="terminate">
206206+ <description summary="send SIGTERM to all sessions on the seat"/>
207207+ </c2s>
208208+ <s2c name="done">
209209+ <description summary="initial field dump complete"/>
210210+ </s2c>
211211+ <s2c name="destroyed">
212212+ <description summary="seat has been removed or did not exist">
213213+ Sent when the seat is destroyed or if the seat name passed to get_seat
214214+ was not found. The client should release this object.
215215+ </description>
216216+ </s2c>
217217+ <s2c name="ok">
218218+ <description summary="last operation completed successfully"/>
219219+ </s2c>
220220+ <s2c name="error">
221221+ <description summary="last operation failed"/>
222222+ <arg name="code" type="enum" interface="error_code" summary="error kind"/>
223223+ <arg name="message" type="varchar" summary="human-readable error detail"/>
224224+ </s2c>
225225+ <c2s name="destroy" destructor="true">
226226+ <description summary="destroy this object"/>
227227+ </c2s>
228228+ <s2c name="can_modify">
229229+ <description summary="client may modify this seat">
230230+ Non-zero if this client may terminate all sessions on this seat.
231231+ </description>
232232+ <arg name="can_modify" type="uint" summary="non-zero if mutating requests are allowed"/>
233233+ </s2c>
234234+ </object>
235235+236236+ <object name="session_core_seat_client" version="1">
237237+ <description summary="per-seat-client information">
238238+ Provides information about a single client attached to a seat. All fields
239239+ are pushed immediately on creation and re-sent if they change.
240240+ </description>
241241+ <s2c name="session">
242242+ <arg name="session" type="uint" summary="seat client session identifier"/>
243243+ </s2c>
244244+ <s2c name="state">
245245+ <arg name="state" type="enum" interface="seat_client_state" summary="seat client state"/>
246246+ </s2c>
247247+ <s2c name="active">
248248+ <arg name="active" type="uint" summary="non-zero if this is the active seat client"/>
249249+ </s2c>
250250+ <s2c name="next">
251251+ <arg name="next" type="uint" summary="non-zero if this client is queued to become active"/>
252252+ </s2c>
253253+ <s2c name="pid">
254254+ <arg name="pid" type="uint" summary="PID of the client that opened the seat"/>
255255+ </s2c>
256256+ <s2c name="uid">
257257+ <arg name="uid" type="uint" summary="UID of the client that opened the seat"/>
258258+ </s2c>
259259+ <s2c name="gid">
260260+ <arg name="gid" type="uint" summary="GID of the client that opened the seat"/>
261261+ </s2c>
262262+ <s2c name="device_added">
263263+ <description summary="seat client device added">
264264+ Sent once per device during the initial dump and whenever a new device is
265265+ assigned to this client. Use get_device with this device_id to retrieve
266266+ the device status object.
267267+ </description>
268268+ <arg name="device_id" type="uint" summary="device id scoped to the seat client"/>
269269+ </s2c>
270270+ <s2c name="device_removed">
271271+ <description summary="seat client device removed"/>
272272+ <arg name="device_id" type="uint" summary="device id scoped to the seat client"/>
273273+ </s2c>
274274+ <s2c name="done">
275275+ <description summary="initial field dump complete"/>
276276+ </s2c>
277277+ <s2c name="destroyed">
278278+ <description summary="seat client has been removed or did not exist">
279279+ Sent when the client is removed or if the PID passed to get_client
280280+ was not found. The client should release this object.
281281+ </description>
282282+ </s2c>
283283+ <c2s name="get_device">
284284+ <description summary="create a per-seat-device info object">
285285+ Creates a session_core_seat_device object for the device with the given
286286+ id on this seat client. The daemon immediately pushes the device fields,
287287+ followed by done, and re-sends fields as they change. If no matching
288288+ device exists, destroyed is sent instead.
289289+ </description>
290290+ <arg name="device_id" type="uint" summary="device id scoped to the seat client"/>
291291+ <returns iface="session_core_seat_device"/>
292292+ </c2s>
293293+ <c2s name="destroy" destructor="true">
294294+ <description summary="destroy this object"/>
295295+ </c2s>
296296+ </object>
297297+298298+ <object name="session_core_seat_device" version="1">
299299+ <description summary="per-seat-device information">
300300+ Provides information about a single device assigned to a seat client. All
301301+ fields are pushed immediately on creation and re-sent if they change.
302302+ </description>
303303+ <s2c name="device_id">
304304+ <arg name="device_id" type="uint" summary="device id scoped to the seat client"/>
305305+ </s2c>
306306+ <s2c name="path">
307307+ <arg name="path" type="varchar" summary="device path"/>
308308+ </s2c>
309309+ <s2c name="kind">
310310+ <arg name="kind" type="enum" interface="seat_device_kind" summary="device kind"/>
311311+ </s2c>
312312+ <s2c name="active">
313313+ <arg name="active" type="uint" summary="non-zero if this device is currently active"/>
314314+ </s2c>
315315+ <s2c name="done">
316316+ <description summary="initial field dump complete"/>
317317+ </s2c>
318318+ <s2c name="destroyed">
319319+ <description summary="seat device has been removed or did not exist">
320320+ Sent when the device is removed or if the device_id passed to get_device
321321+ was not found. The client should release this object.
322322+ </description>
323323+ </s2c>
324324+ <c2s name="destroy" destructor="true">
325325+ <description summary="destroy this object"/>
326326+ </c2s>
327327+ </object>
328328+329329+ <object name="session_core_user" version="1">
330330+ <description summary="per-user information">
331331+ Provides information about a single user, identified by uid.
332332+ All fields are pushed immediately on creation, followed by done.
333333+ </description>
334334+ <s2c name="uid">
335335+ <arg name="uid" type="uint" summary="user id"/>
336336+ </s2c>
337337+ <s2c name="username">
338338+ <arg name="username" type="varchar" summary="username"/>
339339+ </s2c>
340340+ <s2c name="lingering">
341341+ <arg name="lingering" type="uint" summary="non-zero if the user has lingering enabled"/>
342342+ </s2c>
343343+ <s2c name="state">
344344+ <description summary="aggregate user state">
345345+ Reflects whether the user currently has sessions and whether any of
346346+ them is in the foreground, combined with the lingering flag.
347347+ Re-sent whenever it changes.
348348+ </description>
349349+ <arg name="state" type="enum" interface="user_state" summary="user state"/>
350350+ </s2c>
351351+ <s2c name="done">
352352+ <description summary="initial field dump complete"/>
353353+ </s2c>
354354+ <s2c name="not_found">
355355+ <description summary="no such user">
356356+ Sent when the uid passed to get_user does not correspond to a known
357357+ user. The client should release this object.
358358+ </description>
359359+ </s2c>
360360+ <s2c name="ok">
361361+ <description summary="last operation completed successfully"/>
362362+ </s2c>
363363+ <s2c name="error">
364364+ <description summary="last operation failed"/>
365365+ <arg name="code" type="enum" interface="error_code" summary="error kind"/>
366366+ <arg name="message" type="varchar" summary="human-readable error detail"/>
367367+ </s2c>
368368+ <c2s name="terminate">
369369+ <description summary="terminate the user"/>
370370+ </c2s>
371371+ <c2s name="kill">
372372+ <description summary="kill the user"/>
373373+ </c2s>
374374+ <c2s name="destroy" destructor="true">
375375+ <description summary="destroy this object"/>
376376+ </c2s>
377377+ <s2c name="can_modify">
378378+ <description summary="client may modify this user">
379379+ Non-zero if this client may terminate or kill this user's sessions.
380380+ </description>
381381+ <arg name="can_modify" type="uint" summary="non-zero if mutating requests are allowed"/>
382382+ </s2c>
383383+ </object>
384384+385385+ <enum name="user_state">
386386+ <value idx="0" name="offline" summary="no sessions and lingering disabled"/>
387387+ <value idx="1" name="lingering" summary="no sessions but lingering enabled"/>
388388+ <value idx="2" name="online" summary="has a session, none in the foreground"/>
389389+ <value idx="3" name="active" summary="has a session in the foreground"/>
390390+ <value idx="4" name="closing" summary="has sessions, all of them closing"/>
391391+ </enum>
392392+393393+ <enum name="active_state">
394394+ <value idx="0" name="online" summary="session is logged in but not in the foreground"/>
395395+ <value idx="1" name="active" summary="session is in the foreground"/>
396396+ <value idx="2" name="closing" summary="session is being destroyed"/>
397397+ <value idx="3" name="opening" summary="session is being created"/>
398398+ </enum>
399399+400400+ <enum name="seat_mode">
401401+ <value idx="0" name="vt_bound" summary="seat follows the active virtual terminal"/>
402402+ <value idx="1" name="non_vt_bound" summary="seat is not bound to virtual terminals"/>
403403+ </enum>
404404+405405+ <enum name="seat_client_state">
406406+ <value idx="0" name="new" summary="client is not yet enabled"/>
407407+ <value idx="1" name="enabled" summary="client may use seat devices"/>
408408+ <value idx="2" name="pending_disabled" summary="client must acknowledge disabled state"/>
409409+ <value idx="3" name="disabled" summary="client is inactive"/>
410410+ </enum>
411411+412412+ <enum name="seat_device_kind">
413413+ <value idx="0" name="drm" summary="DRM device"/>
414414+ <value idx="1" name="evdev" summary="evdev input device"/>
415415+ <value idx="2" name="hidraw" summary="hidraw device"/>
416416+ <value idx="3" name="wscons" summary="wscons device"/>
417417+ <value idx="4" name="unknown" summary="unknown or unsupported device kind"/>
418418+ </enum>
419419+420420+ <enum name="error_code">
421421+ <value idx="0" name="not_found" summary="session or cgroup not found"/>
422422+ <value idx="1" name="permission_denied" summary="insufficient permissions to signal processes"/>
423423+ <value idx="2" name="io" summary="generic I/O error"/>
424424+ <value idx="3" name="active_sessions" summary="other sessions are active"/>
425425+ </enum>
426426+</protocol>