From bfd2b6558c3dc9ab13e68ccd0ac5026b3dfd1697 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 9 Mar 2018 00:24:33 +0800 Subject: [PATCH] periodic: Remove obsolete daily/status-named and weekly/clean-kvmdb --- Makefile_upgrade.inc | 2 + etc/defaults/periodic.conf | 9 ----- etc/periodic/daily/470.status-named | 62 ----------------------------- etc/periodic/daily/Makefile | 1 - etc/periodic/weekly/120.clean-kvmdb | 50 ----------------------- etc/periodic/weekly/Makefile | 4 +- share/man/man5/periodic.conf.5 | 28 ------------- 7 files changed, 3 insertions(+), 153 deletions(-) delete mode 100644 etc/periodic/daily/470.status-named delete mode 100644 etc/periodic/weekly/120.clean-kvmdb diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index 847cd7a336..a8154cefa7 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -3374,6 +3374,8 @@ TO_REMOVE+=/usr/share/man/man9/untimeout.9.gz TO_REMOVE+=/usr/include/machine/apm_bios.h TO_REMOVE+=/usr/share/man/man2/expreadv.2.gz TO_REMOVE+=/etc/periodic/monthly/300.statistics +TO_REMOVE+=/etc/periodic/weekly/120.clean-kvmdb +TO_REMOVE+=/etc/periodic/daily/470.status-named .if !defined(WANT_INSTALLER) TO_REMOVE+=/usr/sbin/dfuibe_installer diff --git a/etc/defaults/periodic.conf b/etc/defaults/periodic.conf index 30c5e38763..019f53cbf7 100644 --- a/etc/defaults/periodic.conf +++ b/etc/defaults/periodic.conf @@ -122,10 +122,6 @@ daily_status_security_enable="YES" # Security check daily_status_mail_rejects_enable="YES" # Check mail rejects daily_status_mail_rejects_logs=3 # How many logs to check -# 470.status-named -daily_status_named_enable="YES" -daily_status_named_usedns="YES" # DNS lookups are ok - # 500.queuerun daily_queuerun_enable="YES" # Run mail queue daily_submit_queuerun="NO" # Also submit queue @@ -195,11 +191,6 @@ weekly_show_success="YES" # scripts returning 0 weekly_show_info="YES" # scripts returning 1 weekly_show_badconfig="NO" # scripts returning 2 -# 120.clean-kvmdb -weekly_clean_kvmdb_enable="YES" # Clean kvmdb weekly -weekly_clean_kvmdb_days=7 # If not accessed for -weekly_clean_kvmdb_verbose="YES" # Mention files deleted - # 310.locate weekly_locate_enable="YES" # Update locate weekly diff --git a/etc/periodic/daily/470.status-named b/etc/periodic/daily/470.status-named deleted file mode 100644 index b85b6e5839..0000000000 --- a/etc/periodic/daily/470.status-named +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: src/etc/periodic/daily/470.status-named,v 1.8 2006/06/11 20:39:12 maxim Exp $ -# - -# If there is a global system configuration file, suck it in. -# -if [ -r /etc/defaults/periodic.conf ] -then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -catmsgs() { - find /var/log -name 'messages.*' -mtime -2 | - sort -t. -r -n -k 2,2 | - while read f - do - case $f in - *.gz) zcat -f $f;; - *.bz2) bzcat -f $f;; - esac - done - [ -f /var/log/messages ] && cat /var/log/messages -} - -case "$daily_status_named_enable" in - [Yy][Ee][Ss]) - echo - echo 'Checking for denied zone transfers (AXFR and IXFR):' - - start=`date -v-1d '+%b %e'` - rc=$(catmsgs | - grep -E "^$start.*named\[[[:digit:]]+\]: transfer of .*failed .*: REFUSED" | - sed -e "s/.*transfer of \'\(.*\)\/IN\' from \(.*\)#[0-9]*: .*/\1 from \2/" | - sort -f | uniq -ic | ( - usedns=0 - case "$daily_status_named_usedns" in - '') ;; - [yY][eE][sS]) usedns=1 ;; - esac - - while read line ;do - ipaddr=`echo "$line" | sed -e 's/^.*from //'` - if [ $usedns -eq 1 ]; then - name=`host "${ipaddr}" 2>/dev/null | \ - sed 's/.*domain name pointer \(.*\)\./\1/'` - fi - if [ -n "${name}" ]; then - echo "${line} (${name})" - else - echo "${line}" - fi - done ) | \ - tee /dev/stderr | wc -l) - [ $rc -gt 0 ] && rc=1 - ;; - - *) rc=0;; -esac - -exit $rc diff --git a/etc/periodic/daily/Makefile b/etc/periodic/daily/Makefile index 365dcc984e..466fd9b026 100644 --- a/etc/periodic/daily/Makefile +++ b/etc/periodic/daily/Makefile @@ -19,7 +19,6 @@ FILES= 100.clean-disks \ 440.status-mailq \ 450.status-security \ 460.status-mail-rejects \ - 470.status-named \ 500.queuerun \ 999.local diff --git a/etc/periodic/weekly/120.clean-kvmdb b/etc/periodic/weekly/120.clean-kvmdb deleted file mode 100644 index b045a2f409..0000000000 --- a/etc/periodic/weekly/120.clean-kvmdb +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# -# $FreeBSD: src/etc/periodic/weekly/120.clean-kvmdb,v 1.4.2.2 2000/09/20 02:46:17 jkh Exp $ -# $DragonFly: src/etc/periodic/weekly/120.clean-kvmdb,v 1.2 2003/06/17 04:24:48 dillon Exp $ -# - -# If there is a global system configuration file, suck it in. -# -if [ -r /etc/defaults/periodic.conf ]; then - . /etc/defaults/periodic.conf - source_periodic_confs -fi - -case "$weekly_clean_kvmdb_enable" in - [Yy][Ee][Ss]) - if [ ! -d /var/db ] - then - echo '$weekly_clean_kvmdb_enable is set but /var/db' \ - "doesn't exist" - rc=2 - elif [ -z "$weekly_clean_kvmdb_days" ] - then - echo '$weekly_clean_kvmdb_enable is set but' \ - '$weekly_clean_kvmdb_days is not' - rc=2 - else - echo "" - echo "Cleaning up kernel database files:" - - kernel=`sysctl -n kern.bootfile` - kernel=kvm_${kernel##*/}.db - - case "$weekly_clean_kvmdb_verbose" in - [Yy][Ee][Ss]) - print=-print;; - *) - print=;; - esac - - rc=$(find /var/db -name "kvm_*.db" ! -name $kernel \ - -atime +$weekly_clean_kvmdb_days -delete $print | - tee /dev/stderr | wc -l) - [ -z "$print" ] && rc=0 - [ $rc -gt 1 ] && rc=1 - fi;; - - *) rc=0;; -esac - -exit $rc diff --git a/etc/periodic/weekly/Makefile b/etc/periodic/weekly/Makefile index 8d44a37526..3300a6469e 100644 --- a/etc/periodic/weekly/Makefile +++ b/etc/periodic/weekly/Makefile @@ -1,8 +1,6 @@ # $FreeBSD: src/etc/periodic/weekly/Makefile,v 1.4.2.3 2002/07/18 12:36:07 ru Exp $ -# $DragonFly: src/etc/periodic/weekly/Makefile,v 1.4 2006/01/15 11:42:50 swildner Exp $ -FILES= 120.clean-kvmdb \ - 310.locate \ +FILES= 310.locate \ 320.whatis \ 330.catman \ 340.noid \ diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 478670023a..1ad0e8564d 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -596,17 +596,6 @@ for the previous day. .Pq Vt num Set to the number of maillog files that should be checked for yesterday's mail rejects. -.It Va daily_status_named_enable -.Pq Vt bool -Set to -.Dq YES -if you want to summarise denied zone transfers (AXFR and IXFR) -for the previous day. -.It Va daily_status_named_usedns -.Pq Vt bool -Set to -.Dq YES -if you want to enable reverse DNS lookups. .It Va daily_queuerun_enable .Pq Vt bool Set to @@ -631,23 +620,6 @@ All scripts must be absolute path names. The following variables are used by the standard scripts that reside in .Pa /etc/periodic/weekly : .Bl -tag -offset 4n -width 2n -.It Va weekly_clean_kvmdb_enable -.Pq Vt bool -Set to -.Dq YES -if you want to purge old -.Pa /var/db/kvm_*.db -files. -The kvm file for the current kernel will not be purged. -.It Va weekly_clean_kvmdb_days -.Pq Vt num -Set to the number of days that the file must not have been accessed -before being deleted. -.It Va weekly_clean_kvmdb_verbose -.Pq Vt bool -Set to -.Dq YES -if you want the removed files to be reported in your weekly output. .It Va weekly_locate_enable .Pq Vt bool Set to -- 2.41.0