Date: Mon, 31 Mar 2014 03:10:01 GMT From: Jason Unovitch <jason.unovitch@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: conf/188109: [patch] ASSERTION FAILED running individual periodic scripts on 10/11 branches Message-ID: <201403310310.s2V3A1wM092957@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/188109; it has been noted by GNATS. From: Jason Unovitch <jason.unovitch@gmail.com> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403310310.s2V3A1wM092957>