diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index a8763780299..c28241b54fc 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -480,6 +480,8 @@ virecover_enable="YES" # Perform housekeeping for the vi(1) editor ugidfw_enable="NO" # Load mac_bsdextended(4) rules on boot bsdextended_script="/etc/rc.bsdextended" # Default mac_bsdextended(4) # ruleset file. +newsyslog_enable="YES" # Run newsyslog at startup. +newsyslog_flags="-CN" # Newsyslog flags to create marked files ############################################################## ### Jail Configuration ####################################### diff --git a/etc/newsyslog.conf b/etc/newsyslog.conf index ad1e4b495c3..a1c5f98e963 100644 --- a/etc/newsyslog.conf +++ b/etc/newsyslog.conf @@ -19,21 +19,21 @@ # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/all.log 600 7 * @T00 J /var/log/amd.log 644 7 100 * J -/var/log/auth.log 600 7 100 * J +/var/log/auth.log 600 7 100 * JC /var/log/console.log 600 5 100 * J -/var/log/cron 600 3 100 * J +/var/log/cron 600 3 100 * JC /var/log/daily.log 640 7 * @T00 JN -/var/log/debug.log 600 7 100 * J +/var/log/debug.log 600 7 100 * JC /var/log/kerberos.log 600 7 100 * J -/var/log/lpd-errs 644 7 100 * J -/var/log/maillog 640 7 * @T00 J -/var/log/messages 644 5 100 * J +/var/log/lpd-errs 644 7 100 * JC +/var/log/maillog 640 7 * @T00 JC +/var/log/messages 644 5 100 * JC /var/log/monthly.log 640 12 * $M1D0 JN /var/log/pflog 600 3 100 * JB /var/run/pflogd.pid -/var/log/ppp.log root:network 640 3 100 * J -/var/log/security 600 10 100 * J +/var/log/ppp.log root:network 640 3 100 * JC +/var/log/security 600 10 100 * JC /var/log/sendmail.st 640 10 * 168 B -/var/log/slip.log root:network 640 3 100 * J +/var/log/slip.log root:network 640 3 100 * JC /var/log/weekly.log 640 5 1 $W6D0 JN /var/log/wtmp 644 3 * @01T05 B -/var/log/xferlog 600 7 100 * J +/var/log/xferlog 600 7 100 * JC diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index f40d173fd6c..6f895ec904b 100755 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -22,7 +22,7 @@ FILES= DAEMON LOGIN NETWORKING SERVERS \ mixer motd mountcritlocal mountcritremote \ mountd moused mroute6d mrouted msgs \ named natd netif netoptions \ - network_ipv6 nfsclient nfsd \ + network_ipv6 newsyslog nfsclient nfsd \ nfslocking nfsserver nisdomain nsswitch ntpd ntpdate \ othermta \ pccard pcvt pf pflog \ diff --git a/etc/rc.d/newsyslog b/etc/rc.d/newsyslog index 5a3927e125a..9c4ed18aaf8 100755 --- a/etc/rc.d/newsyslog +++ b/etc/rc.d/newsyslog @@ -5,22 +5,23 @@ # # PROVIDE: newsyslog -# REQUIRE: mountcritremote sysdb -# BEFORE: syslogd SERVERS +# REQUIRE: cleanvar mountcritremote +# BEFORE: syslogd . /etc/rc.subr name="newsyslog" -rcvar=$name +rcvar=`set_rcvar` required_files="/etc/newsyslog.conf" +command="/usr/sbin/newsyslog" start_cmd="newsyslog_start" stop_cmd=":" newsyslog_start() { - echo -n "Trimming log files:" - /usr/bin/newsyslog -s $rc_flags - echo " done." + echo -n "Creating and/or trimming log files:" + ${command} ${rc_flags} + echo "." } load_rc_config $name diff --git a/etc/rc.d/var b/etc/rc.d/var index 8c33ac35a38..af6bb9cfccf 100644 --- a/etc/rc.d/var +++ b/etc/rc.d/var @@ -47,8 +47,6 @@ _populate_var() ;; esac - /usr/sbin/newsyslog -CC - # XXX: should create spool dirs for lpd } @@ -85,7 +83,7 @@ case "${populate_var}" in *) if [ -d /var/run -a -d /var/db -a -d /var/empty ] ; then true - elif [ ! -x /usr/sbin/mtree -o ! -x /usr/sbin/newsyslog ] ; then + elif [ ! -x /usr/sbin/mtree ] ; then false else _populate_var