3
.\" Author: Lennart Poettering <lennart@poettering.net>
4
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
10
.TH "SD\-LOGIN" "7" "03/16/2012" "systemd" "sd-login"
11
.\" -----------------------------------------------------------------
12
.\" * Define some portability stuff
13
.\" -----------------------------------------------------------------
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
.\" http://bugs.debian.org/507673
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
.\" -----------------------------------------------------------------
21
.\" * set default formatting
22
.\" -----------------------------------------------------------------
23
.\" disable hyphenation
25
.\" disable justification (adjust text to left margin only)
27
.\" -----------------------------------------------------------------
28
.\" * MAIN CONTENT STARTS HERE *
29
.\" -----------------------------------------------------------------
31
sd-login \- APIs for tracking logins
36
#include <systemd/sd\-login\&.h>
39
.HP \w'\fBpkg\-config\ \-\-cflags\ \-\-libs\ libsystemd\-login\fR\ 'u
40
\fBpkg\-config \-\-cflags \-\-libs libsystemd\-login\fR
44
provides APIs to introspect and monitor seat, login session and user status information on the local system\&.
47
\m[blue]\fBMulti\-Seat on Linux\fR\m[]\&\s-2\u[1]\d\s+2
48
for an introduction into multi\-seat support on Linux, the background for this set of APIs\&.
50
Note that these APIs only allow purely passive access and monitoring of seats, sessions and users\&. To actively make changes to the seat configuration, terminate login sessions, or switch session on a seat you need to utilize the D\-Bus API of systemd\-logind, instead\&.
52
These functions synchronously access data in
56
/run\&. All of these are virtual file systems, hence the runtime cost of the accesses is relatively cheap\&.
58
It is possible (and often a very good choice) to mix calls to the synchronous interface of
60
with the asynchronous D\-Bus interface of systemd\-logind\&. However, if this is done you need to think a bit about possible races since the stream of events from D\-Bus and from
62
interfaces such as the login monitor are asynchronous and not ordered against each other\&.
64
If the functions return string arrays, these are generally NULL terminated and need to be freed by the caller with the libc
66
call after use, including the strings referenced therein\&. Similar, individual strings returned need to be freed, as well\&.
68
As a special exception, instead of an empty string array NULL may be returned, which should be treated equivalent to an empty string array\&.
71
\fBsd_pid_get_session\fR(3),
72
\fBsd_uid_get_state\fR(3),
73
\fBsd_session_is_active\fR(3),
74
\fBsd_seat_get_active\fR(3),
75
\fBsd_get_seats\fR(3),
76
\fBsd_login_monitor_new\fR(3)
77
for more information about the functions implemented\&.
80
These APIs are implemented as shared library, which can be compiled and linked to with the
88
\fBsd_pid_get_session\fR(3),
89
\fBsd_uid_get_state\fR(3),
90
\fBsd_session_is_active\fR(3),
91
\fBsd_seat_get_active\fR(3),
92
\fBsd_get_seats\fR(3),
93
\fBsd_login_monitor_new\fR(3),
95
\fBsd-readahead\fR(7),
99
\fBLennart Poettering\fR <\&lennart@poettering\&.net\&>
107
\%http://www.freedesktop.org/wiki/Software/systemd/multiseat