From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 5 23:10:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 335911065672 for ; Thu, 5 Feb 2009 23:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8D08FC0C for ; Thu, 5 Feb 2009 23:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n15NA1vf058651 for ; Thu, 5 Feb 2009 23:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n15NA1h2058650; Thu, 5 Feb 2009 23:10:01 GMT (envelope-from gnats) Resent-Date: Thu, 5 Feb 2009 23:10:01 GMT Resent-Message-Id: <200902052310.n15NA1h2058650@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steven Kreuzer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 673571065673 for ; Thu, 5 Feb 2009 23:09:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3B9138FC13 for ; Thu, 5 Feb 2009 23:09:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n15N9Bau064195 for ; Thu, 5 Feb 2009 23:09:11 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n15N9Bn3064186; Thu, 5 Feb 2009 23:09:11 GMT (envelope-from nobody) Message-Id: <200902052309.n15N9Bn3064186@www.freebsd.org> Date: Thu, 5 Feb 2009 23:09:11 GMT From: Steven Kreuzer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/131438: Add csup to Periodic X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2009 23:10:02 -0000 >Number: 131438 >Category: misc >Synopsis: Add csup to Periodic >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 05 23:10:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Steven Kreuzer >Release: 7.1-PRERELEASE >Organization: >Environment: FreeBSD slurry.exit2shell.com 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #3: Mon Nov 24 14:01:09 EST 2008 root@simon.sddi.net:/usr/obj/usr/src/sys/KERNEL amd64 >Description: Rather then run csup each night to update src or ports via an entry in roots crontab I figured it would be cleaner to write a script and add it to periodic so that you can specify a csup file and have its output sent to you via email with the rest of the daily periodic scripts The attached patch adds support for that but sets it to off by default. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: etc/defaults/periodic.conf =================================================================== RCS file: /usr/share/cvs/freebsd/src/etc/defaults/periodic.conf,v retrieving revision 1.47 diff -u -r1.47 periodic.conf --- etc/defaults/periodic.conf 8 Jan 2008 07:22:43 -0000 1.47 +++ etc/defaults/periodic.conf 5 Feb 2009 22:54:41 -0000 @@ -140,6 +140,9 @@ daily_queuerun_enable="YES" # Run mail queue daily_submit_queuerun="YES" # Also submit queue +# 600.csup +daily_csup_enable="NO" + # 999.local daily_local="/etc/daily.local" # Local scripts Index: etc/periodic/daily/600.csup =================================================================== RCS file: etc/periodic/daily/600.csup diff -N etc/periodic/daily/600.csup --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ etc/periodic/daily/600.csup 5 Feb 2009 22:56:35 -0000 @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# 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 "$daily_csup_enable" in + [Yy][Ee][Ss]) + if [ -z "$daily_csup_supfile" ] + then + echo '$daily_csup_enable is set but' \ + '$daily_csup_supfile is not' + rc=2 + else + if [ -z "$daily_csup_binary" ] + then + daily_csup_binary=/usr/bin/csup + fi + + if [ ! -x "$daily_csup_binary" ] + then + echo '$daily_csup_binary is set but ' \ + $daily_csup_binary 'is not executable' + rc=2 + else + out=`$daily_csup_binary $daily_csup_supfile` + rc=$? + echo "$out" + fi + + fi;; + + *) rc=0;; +esac + +exit $rc Index: etc/periodic/daily/Makefile =================================================================== RCS file: /usr/share/cvs/freebsd/src/etc/periodic/daily/Makefile,v retrieving revision 1.17 diff -u -r1.17 Makefile --- etc/periodic/daily/Makefile 21 Sep 2008 22:02:26 -0000 1.17 +++ etc/periodic/daily/Makefile 5 Feb 2009 22:55:44 -0000 @@ -16,6 +16,7 @@ 409.status-gconcat \ 420.status-network \ 450.status-security \ + 600.csup \ 999.local # NB: keep these sorted by MK_* knobs >Release-Note: >Audit-Trail: >Unformatted: