logind.conf, logind.conf.d

Login manager configuration files

/etc/systemd/logind.conf
/etc/systemd/logind.conf.d/*.conf
/run/systemd/logind.conf.d/*.conf
/usr/lib/systemd/logind.conf.d/*.conf

configure systemd login manager, systemd-logind.service(8).

Configuration Directories and Precedence

When packages need to customize the configuration, install configuration snippets in /usr/lib/systemd/*.conf.d/..
/etc/ is reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages.
/etc/systemd/logind.conf is read first, subsequent entries override
Files in the logind.conf.d/ are sorted by their filename in lexicographic order, Prefixing filenames with nn- forces ordering.
To disable a configuration file supplied by a vendor, place a symlink to /dev/null in the configuration directory in /etc/ with the same name

[Login] section:

NAutoVTs=n Number of virtual terminals (VTs) to allocate by default that, when switched to and are previously unused, "autovt" services are automatically spawned on.
These services are instantiated from the template unit autovt@.service for the respective VT TTY name, for example, autovt@tty4.service. By default autovt@.service is linked to getty@.service.

In other words, login prompts are started dynamically as the user switches to unused virtual terminals. this controls how many login "gettys" are available on the VTs. If a VT is already used by some other subsystem (for example, a graphical login), this kind of activation will not be attempted.
the VT configured in ReserveVT is always subject to this kind of activation, even if it is not one of the VTs configured with the NAutoVTs= directive. Defaults to 6. 0 disables automatic spawning of autovt

ReserveVT=n Identifies one virtual terminal that shall unconditionally be reserved for autovt@.service activation, will be marked busy, no other subsystem will allocate it.
Useful to ensure that one login getty is always available. Defaults to 6
In other words, there will always be a getty available on Alt-F6.). When set to 0, VT reservation is disabled.
RemoveIPC=yes|no If enabled, after the last of the user's sessions terminated System V semaphores, shared memory and message queues, as well as POSIX shared memory and message queues are released.
IPC objects of root and other system users(?) are excluded from this . Defaults to "yes".
RuntimeDirectorySize=nn[K|M|% Limit on $XDG_RUNTIME_DIR runtime directory for each user in bytes,
KillExcludeUsers= uname uname …
KillOnlyUsers=
Users excluded from having processes killed. If not set root user is excluded, unless set to an empty value.
If a user is not excluded, KillOnlyUsers is checked next. If this setting is specified, only the session scopes of those users will be killed. Otherwise, users are subject to the KillUserProcesses=yes setting.
KillUserProcesses=yes|no Should processes of a user be killed when the user logs out.
yes the scope unit corresponding to the session and all processes inside that scope will be terminated.
no the scope is "abandoned", see systemd.scope(5), and processes are not killed.
Defaults yes

In addition to session processes, user process may run under the user manager user@.service.
This allows users to run processes independent of their login sessions. See enable-linger in loginctl(1).

Setting KillUserProcesses=yes breaks screen(1) and tmux(1), unless they are moved out of the session scope. See example in systemd-run(1).

IdleAction= when the system is idle: ignore, poweroff, reboot, halt, kexec, suspend, hibernate, hybrid-sleep or lock. Default ignore.

The system will execute the action after all sessions report that they are idle, no idle inhibitor lock is active and IdleActionSec has expired.

IdleActionSec=secs delay after which IdleAction is taken after the system is idle.
InhibitDelayMaxSec=secs maximum time a shutdown or sleep is delayed due to an inhibitor lock of delay Defaults 5.
HandlePowerKey=xxx
HandleSuspendKey=xxx
HandleHibernateKey=xxx
HandleLidSwitch=xxx
HandleLidSwitchDocked=xxx
handle power, sleep keys and lid switch to trigger actions
One of ignore, poweroff, reboot, halt, kexec, suspend, hibernate, hybrid-sleep, or lock (all running sessions will be screen-locked)

HandlePowerKey defaults to poweroff (may be overylayed to shutdown)
HandleSuspendKey and HandleLidSwitch default to suspend.
HandleLidSwitchDocked defaults to ignore
HandleHibernateKey defaults to hibernate

Only input devices with the "power-switch" udev tag will be watched for key/lid switch events.

If the system is inserted in a docking station, or if more than one display is connected, the action specified by HandleLidSwitchDocked occurs; otherwise the HandleLidSwitch action occurs.

A different application may disable logind's handling of system power and sleep keys and the lid switch by taking a low-level inhibitor lock (handle-power-key, handle-suspend-key, handle-hibernate-key, handle-lid-switch). This is most commonly used by graphical desktop environments to take over suspend and hibernation handling, and to use their own configuration mechanisms. If a low-level inhibitor lock is taken, logind will not take any action when that key or switch is triggered and the Handle*= settings are irrelevant.

PowerKeyIgnoreInhibited=yes|no
SuspendKeyIgnoreInhibited=yes|no
HibernateKeyIgnoreInhibited=yes|no
LidSwitchIgnoreInhibited=yes|no
actions are subject to high-level inhibitor locks (shutdown, sleep, idle).
Low level inhibitor locks (handle-*-key) are always honored

no : inhibitor locks by applications are respected.
yes : shutdown, sleep and idle inhibitor locks are ignored.

PowerKeyIgnoreInhibited, SuspendKeyIgnoreInhibited and HibernateKeyIgnoreInhibited default to no.
LidSwitchIgnoreInhibited defaults to yes

InhibitorsMax=n maximum concurrent inhibitors . Defaults 8192
HoldoffTimeoutSec=secs after startup or resume, delay reacting to lid events to properly detect hotplugged devices so systemd can ignore lid events if monitors, or docks, are connected. Defaults 30s.
SessionsMax=n maximum number of concurrent user sessions to manage. Defaults to 8192
Depending on how pam_systemd.so is included in the PAM stack configuration, further login sessions will either be refused, or permitted but not tracked by systemd-logind.
UserTasksMax=n maximum number of OS tasks each user may run concurrently. controls TasksMax of the per-user slice unit, see systemd.resource-control(5) .
If assigned infinity no tasks limit Defaults 33%, which equals 10813 with the kernel's defaults on the host, but might be smaller in OS containers.

SEE ALSO systemd(1), systemd-logind.service(8), loginctl(1), systemd-system.conf(5)

From raspnberrypi 5/15/19

 cat /etc/systemd/logind.conf 
#
# Entries in this file show the compile time defaults.
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#UserTasksMax=33%