Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
11 kB · 253 lines
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254<?xml version="1.0" encoding="UTF-8"?><protocol name="session_core_v1" version="1"> <copyright> Copyright (c) 2026 Oskar Rochowiak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </copyright>
<object name="session_core_manager" version="1"> <description summary="session observer"> Unprivileged read-only interface for observing active sessions. </description> <s2c name="session_added"> <description summary="a new session was created"> Broadcast to all connected clients when any session is created. Sent once for each already-active session when the manager is first created. </description> <arg name="session_id" type="uint" summary="new session identifier"/> </s2c> <s2c name="done"> <description summary="initial field dump complete"/> </s2c> <s2c name="error"> <description summary="last operation failed"/> <arg name="code" type="enum" interface="error_code" summary="error kind"/> <arg name="message" type="varchar" summary="human-readable error detail"/> </s2c> <c2s name="get_session"> <description summary="create a per-session info object"> Creates a `session_core_session` object for the given session_id. The daemon immediately pushes all fields, followed by done. If the session does not exist, destroyed is sent instead. </description> <arg name="session_id" type="uint" summary="session to query"/> <returns iface="session_core_session"/> </c2s> <c2s name="get_session_by_pid"> <description summary="create a per-session info object by leader PID"> Creates a session_core_session object for the session whose leader PID matches the given pid. The daemon immediately pushes all fields, followed by done. If no matching session exists, destroyed is sent instead. </description> <arg name="pid" type="uint" summary="leader PID of the session to query"/> <returns iface="session_core_session"/> </c2s> <c2s name="get_session_by_uid"> <description summary="create a per-session info object by user ID"> Creates a session_core_session object for the session whose user ID matches the given uid. The daemon immediately pushes all fields, followed by done. If no matching session exists, destroyed is sent instead. </description> <arg name="uid" type="uint" summary="user ID of the session to query"/> <returns iface="session_core_session"/> </c2s> <c2s name="get_user"> <description summary="create a per-user info object"> Creates a session_core_user object for the given uid. The daemon immediately pushes all fields, followed by done. If uid does not correspond to a known user, not_found is sent instead. </description> <arg name="uid" type="uint" summary="user ID to query"/> <returns iface="session_core_user"/> </c2s> <c2s name="destroy" destructor="true"> <description summary="destroy this object"/> </c2s> </object> <object name="session_core_session" version="1"> <description summary="per-session information"> Provides information about a single session. All fields are pushed immediately on creation and re-sent if they change. </description> <s2c name="session_id"> <arg name="session_id" type="uint" summary="session identifier"/> </s2c> <s2c name="uid"> <arg name="uid" type="uint" summary="user id"/> </s2c> <s2c name="username"> <arg name="username" type="varchar" summary="username"/> </s2c> <s2c name="class"> <arg name="class" type="enum" interface="session_class" summary="session class"/> </s2c> <s2c name="vt"> <arg name="vt" type="uint" summary="virtual terminal number"/> </s2c> <s2c name="leader"> <arg name="leader" type="uint" summary="PID of the session-creating process"/> </s2c> <s2c name="timestamp"> <arg name="timestamp" type="uint" summary="session start time (seconds since Unix epoch)"/> </s2c> <s2c name="is_local"> <arg name="is_local" type="uint" summary="non-zero if the session originates from the local machine, zero if remote"/> </s2c> <s2c name="remote_host"> <arg name="remote_host" type="varchar" summary="remote host name, empty for local sessions"/> </s2c> <s2c name="active"> <description summary="session active state"/> <arg name="state" type="enum" interface="active_state" summary="session active state"/> </s2c> <s2c name="locked"> <description summary="session is locked"/> </s2c> <s2c name="unlocked"> <description summary="session is unlocked"/> </s2c> <s2c name="done"> <description summary="initial field dump complete"/> </s2c> <s2c name="destroyed"> <description summary="session has ended or did not exist"> Sent when the session is destroyed or if the `session_id` passed to `get_session` was not found. The client should release this object. </description> </s2c> <s2c name="ok"> <description summary="last operation completed successfully"/> </s2c> <s2c name="error"> <description summary="last operation failed"/> <arg name="code" type="enum" interface="error_code" summary="error kind"/> <arg name="message" type="varchar" summary="human-readable error detail"/> </s2c> <c2s name="lock"> <description summary="lock the session"/> </c2s> <c2s name="unlock"> <description summary="unlock the session"/> </c2s> <c2s name="terminate"> <description summary="send SIGTERM to all processes in the session"/> </c2s> <c2s name="kill"> <description summary="forcibly kill all processes in the session via cgroup.kill"/> </c2s> <c2s name="destroy" destructor="true"> <description summary="destroy this object"/> </c2s> <s2c name="can_modify"> <description summary="client may modify this session"> Non-zero if this client may lock, unlock, terminate, or kill this session. </description> <arg name="can_modify" type="uint" summary="non-zero if mutating requests are allowed"/> </s2c> </object>
<object name="session_core_user" version="1"> <description summary="per-user information"> Provides information about a single user, identified by uid. All fields are pushed immediately on creation, followed by done. </description> <s2c name="uid"> <arg name="uid" type="uint" summary="user id"/> </s2c> <s2c name="username"> <arg name="username" type="varchar" summary="username"/> </s2c> <s2c name="lingering"> <arg name="lingering" type="uint" summary="non-zero if the user has lingering enabled"/> </s2c> <s2c name="state"> <description summary="aggregate user state"> Reflects whether the user currently has sessions and whether any of them is in the foreground, combined with the lingering flag. Re-sent whenever it changes. </description> <arg name="state" type="enum" interface="user_state" summary="user state"/> </s2c> <s2c name="done"> <description summary="initial field dump complete"/> </s2c> <s2c name="not_found"> <description summary="no such user"> Sent when the uid passed to get_user does not correspond to a known user. The client should release this object. </description> </s2c> <s2c name="ok"> <description summary="last operation completed successfully"/> </s2c> <s2c name="error"> <description summary="last operation failed"/> <arg name="code" type="enum" interface="error_code" summary="error kind"/> <arg name="message" type="varchar" summary="human-readable error detail"/> </s2c> <c2s name="terminate"> <description summary="terminate the user"/> </c2s> <c2s name="kill"> <description summary="kill the user"/> </c2s> <c2s name="destroy" destructor="true"> <description summary="destroy this object"/> </c2s> <s2c name="can_modify"> <description summary="client may modify this user"> Non-zero if this client may terminate or kill this user's sessions. </description> <arg name="can_modify" type="uint" summary="non-zero if mutating requests are allowed"/> </s2c> </object>
<enum name="user_state"> <value idx="0" name="offline" summary="no sessions and lingering disabled"/> <value idx="1" name="lingering" summary="no sessions but lingering enabled"/> <value idx="2" name="online" summary="has a session, none in the foreground"/> <value idx="3" name="active" summary="has a session in the foreground"/> <value idx="4" name="closing" summary="has sessions, all of them closing"/> </enum>
<enum name="active_state"> <value idx="0" name="online" summary="session is logged in but not in the foreground"/> <value idx="1" name="active" summary="session is in the foreground"/> <value idx="2" name="closing" summary="session is being destroyed"/> <value idx="3" name="opening" summary="session is being created"/> </enum>
<enum name="session_class"> <value idx="0" name="user" summary="interactive login session owned by a user"/> <value idx="1" name="greeter" summary="login prompt or display manager session"/> <value idx="2" name="lock_screen" summary="screen locker session associated with an existing login"/> <value idx="3" name="background" summary="non-interactive user session without an attached seat or VT"/> <value idx="4" name="background_light" summary="lightweight background session excluded from idle shutdown accounting"/> <value idx="5" name="manager" summary="per-user service manager session"/> <value idx="6" name="manager_early" summary="early per-user service manager session created before a regular login"/> </enum>
<enum name="error_code"> <value idx="0" name="not_found" summary="session or cgroup not found"/> <value idx="1" name="permission_denied" summary="insufficient permissions to signal processes"/> <value idx="2" name="io" summary="generic I/O error"/> <value idx="3" name="active_sessions" summary="other sessions are active"/> </enum></protocol>