Duplicate motd with util-linux-login
Installing util-linux-login
makes motd being printed twice on login:
alpine:~# apk add util-linux-login
(1/4) Installing libeconf (0.4.4-r0)
(2/4) Installing runuser (2.38-r1)
(3/4) Installing libsmartcols (2.38-r1)
(4/4) Installing util-linux-login (2.38-r1)
Executing busybox-1.35.0-r14.trigger
OK: 116 MiB in 113 packages
alpine:~#
Welcome to Alpine Linux 3.16
Kernel 5.15.41-0-virt on an x86_64 (/dev/ttyS0)
alpine login: root
Password:
Welcome to Alpine!
The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org/>.
You can setup the system with the command: setup-alpine
You may change this message by editing /etc/motd.
Welcome to Alpine!
The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org/>.
You can setup the system with the command: setup-alpine
You may change this message by editing /etc/motd.
alpine:~#
The problem seems to be that our default pam includes pam_motd.so in base-session
, and login itself also prints it.
There is no problem with busybox 'login' as while busybox also prints motd, it does not use pam for session? at least I still get motd after removing pam_motd with busybox.
My suggestion would then just be to remove motd from pam session:
diff --git a/main/linux-pam/base-session.pamd b/main/linux-pam/base-session.pamd
index 3804699b260b..987574d4e272 100644
--- a/main/linux-pam/base-session.pamd
+++ b/main/linux-pam/base-session.pamd
@@ -1,5 +1,4 @@
# basic PAM configuration for Alpine.
session include base-session-noninteractive
-session required pam_motd.so
-session optional pam_elogind.so
If there is no problem with that I'll submit a MR with the above patch in a couple of days.