Browse Source

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 <casey@xogium.me>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Casey Reeves 2 years ago
parent
commit
e6789e8b8b
2 changed files with 27 additions and 2 deletions
  1. 20 0
      package/systemd/Config.in
  2. 7 2
      package/systemd/systemd.mk

+ 20 - 0
package/systemd/Config.in

@@ -518,6 +518,26 @@ config BR2_PACKAGE_SYSTEMD_USERDB
 
 
 	  https://www.freedesktop.org/software/systemd/man/systemd-userdbd.service.html
 	  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
 config BR2_PACKAGE_SYSTEMD_VCONSOLE
 	bool "enable vconsole tool"
 	bool "enable vconsole tool"
 	default y
 	default y

+ 7 - 2
package/systemd/systemd.mk

@@ -87,8 +87,7 @@ SYSTEMD_CONF_OPTS += \
 	-Dtelinit-path= \
 	-Dtelinit-path= \
 	-Dtests=false \
 	-Dtests=false \
 	-Dtmpfiles=true \
 	-Dtmpfiles=true \
-	-Dumount-path=/usr/bin/umount \
-	-Dutmp=false
+	-Dumount-path=/usr/bin/umount
 
 
 SYSTEMD_CFLAGS = $(TARGET_CFLAGS)
 SYSTEMD_CFLAGS = $(TARGET_CFLAGS)
 ifeq ($(BR2_OPTIMIZE_FAST),y)
 ifeq ($(BR2_OPTIMIZE_FAST),y)
@@ -331,6 +330,12 @@ else
 SYSTEMD_CONF_OPTS += -Dbinfmt=false
 SYSTEMD_CONF_OPTS += -Dbinfmt=false
 endif
 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)
 ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE),y)
 SYSTEMD_CONF_OPTS += -Dvconsole=true
 SYSTEMD_CONF_OPTS += -Dvconsole=true
 else
 else