From e6789e8b8b5f39e0efb9f4a9af492de416c121c8 Mon Sep 17 00:00:00 2001 From: Casey Reeves Date: Wed, 18 Jan 2023 20:49:25 +0100 Subject: [PATCH] package/systemd: reenable utmp support This patch provides a way to enable utmp support when using systemd, with it disabled by default, as some security concerns may apply. Still, there are cases where having utmp is desirable, even though it is rare, so let's make this configurable. See commit 32f53bdfb482d0d78308e548c654898089b5c183. Signed-off-by: Casey Reeves Signed-off-by: Yann E. MORIN --- package/systemd/Config.in | 20 ++++++++++++++++++++ package/systemd/systemd.mk | 9 +++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/package/systemd/Config.in b/package/systemd/Config.in index 45a9e2d644..33ac03e584 100644 --- a/package/systemd/Config.in +++ b/package/systemd/Config.in @@ -518,6 +518,26 @@ config BR2_PACKAGE_SYSTEMD_USERDB https://www.freedesktop.org/software/systemd/man/systemd-userdbd.service.html +config BR2_PACKAGE_SYSTEMD_UTMP + bool "enable utmp support" + help + systemd-update-utmp-runlevel.service is a service that writes + SysV runlevel changes to utmp and wtmp, as well as the audit + logs, as they occur. systemd-update-utmp.service does the + same for system reboots and shutdown requests. + + https://www.freedesktop.org/software/systemd/man/systemd-update-utmp.service.html + + Utmp keeps track of what users do on the system (where they + logged from, on which terminal, ...) along with a general + status of the system (list of reboots, current uptime, current + number of users logged in). + + You should only enable this if your system will have actual + users who log in. + + https://man7.org/linux/man-pages/man5/utmp.5.html + config BR2_PACKAGE_SYSTEMD_VCONSOLE bool "enable vconsole tool" default y diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk index b96873b73f..f191542866 100644 --- a/package/systemd/systemd.mk +++ b/package/systemd/systemd.mk @@ -87,8 +87,7 @@ SYSTEMD_CONF_OPTS += \ -Dtelinit-path= \ -Dtests=false \ -Dtmpfiles=true \ - -Dumount-path=/usr/bin/umount \ - -Dutmp=false + -Dumount-path=/usr/bin/umount SYSTEMD_CFLAGS = $(TARGET_CFLAGS) ifeq ($(BR2_OPTIMIZE_FAST),y) @@ -331,6 +330,12 @@ else SYSTEMD_CONF_OPTS += -Dbinfmt=false endif +ifeq ($(BR2_PACKAGE_SYSTEMD_UTMP),y) +SYSTEMD_CONF_OPTS += -Dutmp=true +else +SYSTEMD_CONF_OPTS += -Dutmp=false +endif + ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE),y) SYSTEMD_CONF_OPTS += -Dvconsole=true else