Subject: bin/411: rc.local always changes time stamp of motd
To: None <gnats-admin>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 08/12/1994 00:20:08
>Number:         411
>Category:       bin
>Synopsis:       rc.local always changes time stamp of motd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 12 00:20:05 1994
>Originator:     Thorsten Lockert
>Organization:
SigmaSoft, Th. Lockert
>Release:        current
>Environment:
System: NetBSD gandalf.bbb.no 1.0-ALPHA NetBSD 1.0-ALPHA (GANDALF) #2: Sun Jul 24 18:47:54 MET DST 1994 tholo@gandalf.bbb.no:/usr/src/sys/arch/i386/compile/GANDALF i386


>Description:
	Having user programs only display /etc/motd if it has been changed
	since last time it was displayed works fine, unless you reboot. Then
	the time stamp on /etc/motd is changed, even if the contents are
	exactly the same (ie. no new kernel has been installed etc).

>How-To-Repeat:
	Check time stamp of /etc/motd.  Reboot.  Check time stamp again.

>Fix:
	Apply following patch.

--- rc.local.old	Fri Aug 12 09:04:55 1994
+++ rc.local		Fri Aug 12 09:05:41 1994
@@ -13,8 +13,12 @@
 sysctl -n kern.version | sed 1q > $T
 echo "" >> $T
 sed '1,/^$/d' < /etc/motd >> $T
-cp $T /etc/motd
-rm -f $T
+if cmp -s $T /etc/motd; then
+	rm -f $T
+else
+	cp $T /etc/motd
+	rm -f $T
+fi
 
 echo -n 'starting local daemons:'
 
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------