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