]> git.ipfire.org Git - thirdparty/systemd.git/blob - units/systemd-logind.service.in
units: make sure logind can properly reference drm char class
[thirdparty/systemd.git] / units / systemd-logind.service.in
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # This file is part of systemd.
4 #
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
9
10 [Unit]
11 Description=Login Service
12 Documentation=man:systemd-logind.service(8) man:logind.conf(5)
13 Documentation=https://www.freedesktop.org/wiki/Software/systemd/logind
14 Documentation=https://www.freedesktop.org/wiki/Software/systemd/multiseat
15 Wants=user.slice
16 After=nss-user-lookup.target user.slice
17
18 # Ask for the dbus socket.
19 Wants=dbus.socket
20 After=dbus.socket
21
22 [Service]
23 BusName=org.freedesktop.login1
24 CapabilityBoundingSet=CAP_SYS_ADMIN CAP_MAC_ADMIN CAP_AUDIT_CONTROL CAP_CHOWN CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG CAP_LINUX_IMMUTABLE
25 DeviceAllow=char-/dev/console rw
26 DeviceAllow=char-drm rw
27 DeviceAllow=char-input rw
28 DeviceAllow=char-tty rw
29 DeviceAllow=char-vcs rw
30 # Make sure the DeviceAllow= lines above can work correctly when referenceing char-drm
31 ExecStartPre=-/sbin/modprobe -abq drm
32 ExecStart=@rootlibexecdir@/systemd-logind
33 FileDescriptorStoreMax=512
34 IPAddressDeny=any
35 LockPersonality=yes
36 MemoryDenyWriteExecute=yes
37 NoNewPrivileges=yes
38 PrivateTmp=yes
39 ProtectControlGroups=yes
40 ProtectHome=yes
41 ProtectHostname=yes
42 ProtectKernelModules=yes
43 ProtectSystem=strict
44 ReadWritePaths=/etc /run
45 Restart=always
46 RestartSec=0
47 RestrictAddressFamilies=AF_UNIX AF_NETLINK
48 RestrictNamespaces=yes
49 RestrictRealtime=yes
50 RestrictSUIDSGID=yes
51 RuntimeDirectory=systemd/sessions systemd/seats systemd/users systemd/inhibit systemd/shutdown
52 RuntimeDirectoryPreserve=yes
53 StateDirectory=systemd/linger
54 SystemCallArchitectures=native
55 SystemCallErrorNumber=EPERM
56 SystemCallFilter=@system-service
57 WatchdogSec=3min
58
59 # Increase the default a bit in order to allow many simultaneous logins since
60 # we keep one fd open per session.
61 LimitNOFILE=@HIGH_RLIMIT_NOFILE@