From owner-freebsd-bugs Wed Sep 13 6:20:10 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id ABF6E37B42C for ; Wed, 13 Sep 2000 06:20:00 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id GAA72737; Wed, 13 Sep 2000 06:20:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id E617F37B423; Wed, 13 Sep 2000 06:19:23 -0700 (PDT) Message-Id: <20000913131923.E617F37B423@hub.freebsd.org> Date: Wed, 13 Sep 2000 06:19:23 -0700 (PDT) From: jbarkley@wgate.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/21250: Periodic scripts that are 'disabled' have non-zero return code. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 21250 >Category: misc >Synopsis: Periodic scripts that are 'disabled' have non-zero return code. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Sep 13 06:20:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Jim Barkley >Release: 4.1 >Organization: WorldGate Communications >Environment: FreeBSD client40.tics35.eng.tvol.net 4.1-STABLE FreeBSD 4.1-STABLE #0: Mon Sep 11 12:08:42 EDT 2000 root@client40.tics35.eng.tvol.net:/usr/src/sys/compile/TICS i386 >Description: We have tweaked the main periodic script so that it only sends mail upon the detection of an error condition. Error conditions are generally defined by the subscript placing the string **ERROR** in its output. Additionally we check for writes to stderr and the return code of the subscripts. The latest update to the periodic subscripts utilize an case command to determine if they are to be executed or not. Unfortunatley there is only one pattern given. When the case command is unable to match any pattern it sets a return code of 1. As this is the last command executed in the subscript this return code is sent back to the periodic script >How-To-Repeat: Modify periodic (in /usr/sbin) to report the subscript and its return code. Notice that 'disabled' subscript have a return code of 1 and 'enabled' subscripts have a return code of 0. >Fix: The following can be used to patch the daily scripts with a default pattern: --- old/100.clean-disks Wed Sep 13 08:30:34 2000 +++ new/100.clean-disks Wed Sep 13 08:34:38 2000 @@ -34,4 +34,6 @@ \( $args \) -atime +$daily_clean_disks_days -delete $print set -f glob fi;; + *) #Do nothing + ;; esac diff -u old/110.clean-tmps new/110.clean-tmps --- old/110.clean-tmps Wed Sep 13 08:30:34 2000 +++ new/110.clean-tmps Wed Sep 13 08:34:38 2000 @@ -43,4 +43,6 @@ done set -f glob fi;; + *) #Do nothing + ;; esac diff -u old/120.clean-preserve new/120.clean-preserve --- old/120.clean-preserve Wed Sep 13 08:30:34 2000 +++ new/120.clean-preserve Wed Sep 13 08:34:38 2000 @@ -31,4 +31,6 @@ find . ! -name . -mtime +$daily_clean_preserve_days \ -delete $print fi;; + *) #Do nothing + ;; esac diff -u old/130.clean-msgs new/130.clean-msgs --- old/130.clean-msgs Wed Sep 13 08:30:34 2000 +++ new/130.clean-msgs Wed Sep 13 08:34:38 2000 @@ -24,4 +24,6 @@ arg=-${daily_clean_msgs_days#-} || arg= msgs -c $arg fi;; + *) #Do nothing + ;; esac diff -u old/140.clean-rwho new/140.clean-rwho --- old/140.clean-rwho Wed Sep 13 08:30:34 2000 +++ new/140.clean-rwho Wed Sep 13 08:34:38 2000 @@ -30,4 +30,6 @@ cd /var/rwho && find . ! -name . -mtime +$daily_clean_rwho_days -delete $print fi;; + *) #Do nothing + ;; esac diff -u old/150.clean-hoststat new/150.clean-hoststat --- old/150.clean-hoststat Wed Sep 13 08:30:34 2000 +++ new/150.clean-hoststat Wed Sep 13 08:34:38 2000 @@ -31,4 +31,6 @@ find . ! -name . -mtime +$daily_clean_hoststat_days \ -delete $print fi;; + *) #Do nothing + ;; esac diff -u old/200.backup-passwd new/200.backup-passwd --- old/200.backup-passwd Wed Sep 13 08:30:34 2000 +++ new/200.backup-passwd Wed Sep 13 08:34:38 2000 @@ -56,4 +56,6 @@ chkgrp /etc/group fi fi;; + *) #Do nothing + ;; esac diff -u old/210.backup-aliases new/210.backup-aliases --- old/210.backup-aliases Wed Sep 13 08:30:34 2000 +++ new/210.backup-aliases Wed Sep 13 08:34:38 2000 @@ -34,4 +34,6 @@ cp -p /etc/mail/aliases $bak/aliases.bak fi fi;; + *) #Do nothing + ;; esac diff -u old/220.backup-distfile new/220.backup-distfile --- old/220.backup-distfile Wed Sep 13 08:30:34 2000 +++ new/220.backup-distfile Wed Sep 13 08:34:38 2000 @@ -26,4 +26,6 @@ cp /etc/Distfile $bak/Distfile.bak fi fi;; + *) #Do nothing + ;; esac diff -u old/300.calendar new/300.calendar --- old/300.calendar Wed Sep 13 08:30:34 2000 +++ new/300.calendar Wed Sep 13 08:34:38 2000 @@ -25,4 +25,6 @@ calendar -a fi;; + *) #Do nothing + ;; esac diff -u old/310.accounting new/310.accounting --- old/310.accounting Wed Sep 13 08:30:34 2000 +++ new/310.accounting Wed Sep 13 08:34:38 2000 @@ -35,4 +35,6 @@ gzip -f acct.0;; esac fi;; + *) #Do nothing + ;; esac diff -u old/320.rdist new/320.rdist --- old/320.rdist Wed Sep 13 08:30:34 2000 +++ new/320.rdist Wed Sep 13 08:34:38 2000 @@ -20,4 +20,6 @@ rdist -f /etc/Distfile fi;; + *) #Do nothing + ;; esac diff -u old/330.news new/330.news --- old/330.news Wed Sep 13 08:30:34 2000 +++ new/330.news Wed Sep 13 08:34:38 2000 @@ -23,4 +23,6 @@ /etc/news.expire fi;; + *) #Do nothing + ;; esac diff -u old/340.uucp new/340.uucp --- old/340.uucp Wed Sep 13 08:30:34 2000 +++ new/340.uucp Wed Sep 13 08:34:38 2000 @@ -23,4 +23,6 @@ echo /etc/uuclean.daily | su -m uucp fi;; + *) #Do nothing + ;; esac diff -u old/400.status-disks new/400.status-disks --- old/400.status-disks Wed Sep 13 08:30:34 2000 +++ new/400.status-disks Wed Sep 13 08:34:38 2000 @@ -22,4 +22,6 @@ echo "" dump W;; + *) #Do nothing + ;; esac diff -u old/410.status-uucp new/410.status-uucp --- old/410.status-uucp Wed Sep 13 08:30:34 2000 +++ new/410.status-uucp Wed Sep 13 08:34:38 2000 @@ -20,4 +20,6 @@ uustat -a fi;; + *) #Do nothing + ;; esac diff -u old/420.status-network new/420.status-network --- old/420.status-network Wed Sep 13 08:30:34 2000 +++ new/420.status-network Wed Sep 13 08:34:38 2000 @@ -25,4 +25,6 @@ netstat -in;; esac fi;; + *) #Do nothing + ;; esac diff -u old/430.status-rwho new/430.status-rwho --- old/430.status-rwho Wed Sep 13 08:30:34 2000 +++ new/430.status-rwho Wed Sep 13 08:34:38 2000 @@ -24,4 +24,6 @@ echo "Local system status:" uptime fi;; + *) #Do nothing + ;; esac diff -u old/440.status-mailq new/440.status-mailq --- old/440.status-mailq Wed Sep 13 08:30:34 2000 +++ new/440.status-mailq Wed Sep 13 08:34:38 2000 @@ -30,4 +30,6 @@ mailq;; esac fi;; + *) #Do nothing + ;; esac diff -u old/450.status-security new/450.status-security --- old/450.status-security Wed Sep 13 08:30:34 2000 +++ new/450.status-security Wed Sep 13 08:34:38 2000 @@ -39,4 +39,6 @@ sh /etc/security $args 2>&1 | sendmail root;; esac fi;; + *) #Do nothing + ;; esac diff -u old/460.status-mail-rejects new/460.status-mail-rejects --- old/460.status-mail-rejects Wed Sep 13 08:30:34 2000 +++ new/460.status-mail-rejects Wed Sep 13 08:34:38 2000 @@ -39,4 +39,6 @@ if (/reject=/ and /^$start.*ruleset=check_\S+,\s+arg1=(<[^@]+@)?([^>,]+).*reject=/o);" | sort | uniq -c | sort -nr fi;; + *) #Do nothing + ;; esac diff -u old/999.local new/999.local --- old/999.local Wed Sep 13 08:30:34 2000 +++ new/999.local Wed Sep 13 08:34:38 2000 @@ -26,4 +26,6 @@ sh $script fi;; esac + *) #Do nothing + ;; done >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message