Hi,
Attached is a small patch which allows users to disable the MOTD
updating altogether in a straightforward way - by replacing it with a
real file or symlink pointing somewhere else.

Note that the SELinux policy currently probably (and probably will
always, unless you implement #437176, splitting the motd updating out
into a separate script!) will break MOTD updating anyway.
So with this patch, all the user would need to to is to replace the motd
file with a static version.

best regards,
Erich Schubert
-- 
     erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C     (o_
The problem with the future is that it keeps turning into the present. //\
   Wenn zwei gute Freunde sind, die einander kennen, Sonn' und Mond    V_/_
     begegnen sich, ehe sie sich trennen. --- Clemens von Brentano
--- /etc/init.d/bootmisc.sh	2008-01-01 10:26:05.000000000 +0100
+++ /tmp/bootmisc.sh	2008-02-07 16:25:13.000000000 +0100
@@ -40,8 +40,10 @@
 	fi
 
 	# Update motd
-	uname -snrvm > /var/run/motd
-	[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
+	if [ -L /etc/motd -a "$(readlink /etc/motd)" = "/var/run/motd" ]; then
+		uname -snrvm > /var/run/motd
+		[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
+	fi
 
 	# Save kernel messages in /var/log/dmesg
 	if which dmesg >/dev/null 2>&1

Reply via email to