logind: implement maintenance time
authorLudwig Nussel <ludwig.nussel@suse.de>
Mon, 6 May 2024 13:55:16 +0000 (15:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Jun 2024 12:37:42 +0000 (14:37 +0200)
commit0e10c3d8724b0a5d07871c9de71565ac91dd55b7
tree3d3933ce8f8c79fd901ffecc5497fda053585c2b
parente262205eb728de09ec1e669d239275d605f200b4
logind: implement maintenance time

Update frameworks that work automatically in the background
occasionally need to schedule reboots. Systemd-logind already
provides a nice mechanism to schedule shutdowns, send notfications
and block logins short before the time. Systemd has a framework for
calendar events, so we may conveniently use logind to define a
maintenance time for reboots.

The existing ScheduleShutdown DBus method in logind expects a usec_t
with an absolute time. Passing USEC_INFINITY as magic value now tells
logind to take the time from the configured maintenance time if set.

"shutdown -r" leverages that and uses the maintenance time
automatically if configured. The one minute default is still used if
nothing was specified.

Similarly the new 'auto' setting for the --when parameter of systemctl
uses the maintenance time if configured or a one minute timer like the
shutdown command.
17 files changed:
man/logind.conf.xml
man/org.freedesktop.login1.xml
man/systemctl.xml
src/libsystemd/sd-bus/bus-common-errors.c
src/libsystemd/sd-bus/bus-common-errors.h
src/login/logind-core.c
src/login/logind-dbus.c
src/login/logind-gperf.gperf
src/login/logind.conf.in
src/login/logind.h
src/shared/conf-parser.c
src/shared/conf-parser.h
src/systemctl/systemctl-compat-shutdown.c
src/systemctl/systemctl-logind.c
src/systemctl/systemctl-start-special.c
src/systemctl/systemctl.c
src/systemctl/systemctl.h