summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/var
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-03-01 22:08:15 +0000
committerbrooks <brooks@FreeBSD.org>2005-03-01 22:08:15 +0000
commitae565b7e33e330442c80d720605978f191d4413f (patch)
treed3ab2f129c2e02847804a096f89b50f9bdfda427 /etc/rc.d/var
parent92310fbdd7e1345d153293b1f14f6941b1ddc9ef (diff)
downloadFreeBSD-src-ae565b7e33e330442c80d720605978f191d4413f.zip
FreeBSD-src-ae565b7e33e330442c80d720605978f191d4413f.tar.gz
- Remove the dependency of /usr/bin/touch by using "cp /dev/null <target>"
to create /var/log/lastlog. - Also create /var/log/wtmp if missing. - Attempt to create these files unless populate_var is NO rather then only when /var is empty or populate_var=YES.
Diffstat (limited to 'etc/rc.d/var')
-rw-r--r--etc/rc.d/var16
1 files changed, 12 insertions, 4 deletions
diff --git a/etc/rc.d/var b/etc/rc.d/var
index 1e506c0..8c33ac3 100644
--- a/etc/rc.d/var
+++ b/etc/rc.d/var
@@ -49,8 +49,6 @@ _populate_var()
/usr/sbin/newsyslog -CC
- /usr/bin/touch /var/log/lastlog
-
# XXX: should create spool dirs for lpd
}
@@ -82,15 +80,25 @@ case "${populate_var}" in
_populate_var
;;
[Nn][Oo])
+ exit 0
;;
*)
if [ -d /var/run -a -d /var/db -a -d /var/empty ] ; then
true
- elif [ ! -x /usr/sbin/mtree -o ! -x /usr/sbin/newsyslog -o \
- ! -x /usr/bin/touch ] ; then
+ elif [ ! -x /usr/sbin/mtree -o ! -x /usr/sbin/newsyslog ] ; then
false
else
_populate_var
fi
;;
esac
+
+# Make sure we have /var/log/lastlog and /var/log/wtmp files
+if [ ! -f /var/log/lastlog ]; then
+ cp /dev/null /var/log/lastlog
+ chmod 644 /var/log/lastlog
+fi
+if [ ! -f /var/log/wtmp ]; then
+ cp /dev/null /var/log/wtmp
+ chmod 644 /var/log/wtmp
+fi
OpenPOWER on IntegriCloud