1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

- 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.
This commit is contained in:
Brooks Davis 2005-03-01 22:08:15 +00:00
parent 95e2054492
commit a721bd4891
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142957

View File

@ -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