From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 31 03:10:01 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98D3C427 for ; Mon, 31 Mar 2014 03:10:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85A56CB3 for ; Mon, 31 Mar 2014 03:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2V3A12Y092958 for ; Mon, 31 Mar 2014 03:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s2V3A1wM092957; Mon, 31 Mar 2014 03:10:01 GMT (envelope-from gnats) Date: Mon, 31 Mar 2014 03:10:01 GMT Message-Id: <201403310310.s2V3A1wM092957@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Jason Unovitch Subject: Re: conf/188109: [patch] ASSERTION FAILED running individual periodic scripts on 10/11 branches X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Jason Unovitch List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 03:10:01 -0000 The following reply was made to PR conf/188109; it has been noted by GNATS. From: Jason Unovitch To: bug-followup@FreeBSD.org Cc: Subject: Re: conf/188109: [patch] ASSERTION FAILED running individual periodic scripts on 10/11 branches Date: Sun, 30 Mar 2014 23:03:00 -0400 This is a multi-part message in MIME format. --------------070406080500060600050802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Two alternate version of patches I worked are attached for ideas if the patch submitted is not acceptable. - Jason Unovitch --------------070406080500060600050802 Content-Type: text/x-patch; name="defaults-periodic-2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="defaults-periodic-2.diff" Index: periodic.conf =================================================================== --- periodic.conf (revision 263916) +++ periodic.conf (working copy) @@ -361,9 +361,14 @@ esac ;; *) - echo "ASSERTION FAILED: Unexpected value for " \ - "\$PERIODIC: '$PERIODIC'" >&2 - exit 127 + # Execute when undefined (run from shell), else warn and quit + if [ -z "$PERIODIC" ]; then + return 0 + else + echo "ASSERTION FAILED: Unexpected value for " \ + "\$PERIODIC: '$PERIODIC'" >&2 + exit 127 + fi ;; esac } --------------070406080500060600050802 Content-Type: text/x-patch; name="defaults-periodic-3.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="defaults-periodic-3.diff" Index: periodic.conf =================================================================== --- periodic.conf (revision 263916) +++ periodic.conf (working copy) @@ -334,38 +334,43 @@ periodvar=${var%enable}period eval period=\"\$$periodvar\" - case "$PERIODIC" in - "security daily") - case "$period" in - [Dd][Aa][Ii][Ll][Yy]) return 0 ;; - *) return 1 ;; + # Execute when undefined (run from shell), else warn and quit + if [ -z "$PERIODIC" ]; then + return 0 + else + case "$PERIODIC" in + "security daily") + case "$period" in + [Dd][Aa][Ii][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + "security weekly") + case "$period" in + [Ww][Ee][Ee][Kk][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + "security monthly") + case "$period" in + [Mm][Oo][Nn][Tt][Hh][Ll][Yy]) return 0 ;; + *) return 1 ;; + esac + ;; + security) + # Run directly from crontab(5). + case "$period" in + [Nn][Oo]) return 1 ;; + *) return 0 ;; + esac + ;; + *) + echo "ASSERTION FAILED: Unexpected value for " \ + "\$PERIODIC: '$PERIODIC'" >&2 + exit 127 + ;; esac - ;; - "security weekly") - case "$period" in - [Ww][Ee][Ee][Kk][Ll][Yy]) return 0 ;; - *) return 1 ;; - esac - ;; - "security monthly") - case "$period" in - [Mm][Oo][Nn][Tt][Hh][Ll][Yy]) return 0 ;; - *) return 1 ;; - esac - ;; - security) - # Run directly from crontab(5). - case "$period" in - [Nn][Oo]) return 1 ;; - *) return 0 ;; - esac - ;; - *) - echo "ASSERTION FAILED: Unexpected value for " \ - "\$PERIODIC: '$PERIODIC'" >&2 - exit 127 - ;; - esac + fi } source_periodic_confs() { --------------070406080500060600050802--