summaryrefslogtreecommitdiff
path: root/man/sd-login.3
blob: 31bb15ce6fbc3edb7620635bab5062a765dc76c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
'\" t
.TH "SD\-LOGIN" "3" "" "systemd 220" "sd-login"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
sd-login \- APIs for tracking logins
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <systemd/sd\-login\&.h>
.fi
.ft
.HP \w'\fBpkg\-config\ \-\-cflags\ \-\-libs\ libsystemd\fR\ 'u
\fBpkg\-config \-\-cflags \-\-libs libsystemd\fR
.SH "DESCRIPTION"
.PP
sd\-login\&.h
provides APIs to introspect and monitor seat, login session and user status information on the local system\&.
.PP
See
\m[blue]\fBMulti\-Seat on Linux\fR\m[]\&\s-2\u[1]\d\s+2
for an introduction into multi\-seat support on Linux, the background for this set of APIs\&.
.PP
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\&.
.PP
These functions synchronously access data in
/proc,
/sys/fs/cgroup
and
/run\&. All of these are virtual file systems, hence the runtime cost of the accesses is relatively cheap\&.
.PP
It is possible (and often a very good choice) to mix calls to the synchronous interface of
sd\-login\&.h
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
sd\-login\&.h
interfaces such as the login monitor are asynchronous and not ordered against each other\&.
.PP
If the functions return string arrays, these are generally
\fBNULL\fR
terminated and need to be freed by the caller with the libc
\fBfree\fR(3)
call after use, including the strings referenced therein\&. Similarly, individual strings returned need to be freed, as well\&.
.PP
As a special exception, instead of an empty string array
\fBNULL\fR
may be returned, which should be treated equivalent to an empty string array\&.
.PP
See
\fBsd_pid_get_session\fR(3),
\fBsd_uid_get_state\fR(3),
\fBsd_session_is_active\fR(3),
\fBsd_seat_get_active\fR(3),
\fBsd_get_seats\fR(3),
\fBsd_login_monitor_new\fR(3)
for more information about the functions implemented\&.
.SH "NOTES"
.PP
These APIs are implemented as a shared library, which can be compiled and linked to with the
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
file\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsd_pid_get_session\fR(3),
\fBsd_uid_get_state\fR(3),
\fBsd_session_is_active\fR(3),
\fBsd_seat_get_active\fR(3),
\fBsd_get_seats\fR(3),
\fBsd_login_monitor_new\fR(3),
\fBsd-daemon\fR(3),
\fBpkg-config\fR(1)
.SH "NOTES"
.IP " 1." 4
Multi-Seat on Linux
.RS 4
\%http://www.freedesktop.org/wiki/Software/systemd/multiseat
.RE