diff options
author | brooks <brooks@FreeBSD.org> | 2005-03-01 22:08:15 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-03-01 22:08:15 +0000 |
commit | ae565b7e33e330442c80d720605978f191d4413f (patch) | |
tree | d3ab2f129c2e02847804a096f89b50f9bdfda427 /etc/rc.d/var | |
parent | 92310fbdd7e1345d153293b1f14f6941b1ddc9ef (diff) | |
download | FreeBSD-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/var | 16 |
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 |