From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 21 15:00:11 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04E2516A41F for ; Thu, 21 Jun 2007 15:00:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id D310613C468 for ; Thu, 21 Jun 2007 15:00:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5LF0ALB008975 for ; Thu, 21 Jun 2007 15:00:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5LF0AX8008971; Thu, 21 Jun 2007 15:00:10 GMT (envelope-from gnats) Resent-Date: Thu, 21 Jun 2007 15:00:10 GMT Resent-Message-Id: <200706211500.l5LF0AX8008971@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, Oliver Fromme Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFE6816A400 for ; Thu, 21 Jun 2007 14:56:48 +0000 (UTC) (envelope-from olli@secnetix.de) Received: from pluto.secnetix.de (pluto.secnetix.de [88.198.44.136]) by mx1.freebsd.org (Postfix) with ESMTP id 5E50213C45A for ; Thu, 21 Jun 2007 14:56:48 +0000 (UTC) (envelope-from olli@secnetix.de) Received: from pluto.secnetix.de (localhost.secnetix.de [127.0.0.1]) by pluto.secnetix.de (8.14.1/8.14.1) with ESMTP id l5LEcHVS002994; Thu, 21 Jun 2007 16:38:22 +0200 (CEST) (envelope-from olli@pluto.secnetix.de) Received: (from olli@localhost) by pluto.secnetix.de (8.14.1/8.14.1/Submit) id l5LEcHrT002993; Thu, 21 Jun 2007 16:38:17 +0200 (CEST) (envelope-from olli) Message-Id: <200706211438.l5LEcHrT002993@pluto.secnetix.de> Date: Thu, 21 Jun 2007 16:38:17 +0200 (CEST) From: Oliver Fromme To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Oliver Fromme Subject: conf/113913: New file: /etc/periodic/daily/490.status-pkg-changes X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Oliver Fromme List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 15:00:11 -0000 >Number: 113913 >Category: conf >Synopsis: New file: /etc/periodic/daily/490.status-pkg-changes >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: Thu Jun 21 15:00:10 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: FreeBSD 6.2-STABLE-20070615 i386 >Organization: secnetix GmbH & Co. KG http://www.secnetix.de/bsd >Environment: FreeBSD RELENG_6 and HEAD (7-current) >Description: The script below adds a new status report to the daily periodic output: A paragraph that lists packages that have been added, updated or deleted in the past 24 hours. That information is particularly useful on servers that are maintained by multiple administrators. When someone adds, updates or deletes a package, the others will see it in the daily periodic output. Such a paragraph looks like this (example): Changes in installed packages: -gawk-3.1.1_1 The GNU version of Awk +gawk-3.1.5 The GNU version of Awk -ispell-3.2.06_17 An interactive spelling checker for multiple languages -w3m-0.5.1_6 A pager/text-based WWW browser +w3m-0.5.2 A pager/text-based WWW browser +zsh-4.3.2_1 The Z shell Of course, if there are no changes, nothing is displayed at all. The format is intentionally simple and compact. >How-To-Repeat: Save the script below as /etc/periodic/daily/490.status-pkg-changes and add this line to /etc/periodic.conf: daily_status_pkg_changes_enable="YES" Suggested default entry for /etc/defaults/periodic.conf: # 490.status-pkg-changes daily_status_pkg_changes_enable="NO" # Show package changes >Fix: #!/bin/sh - # Show which packages have been added, updated or deleted. # 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_status_pkg_changes_enable" in [Yy][Ee][Ss]) if [ ! -f /usr/sbin/pkg_info ]; then echo '$daily_status_pkg_changes_enable is enabled but' \ "/usr/sbin/pkg_info doesn't exist" rc=2 else bak=/var/backups rc=0 if [ -f $bak/pkg_info.bak ]; then mv -f $bak/pkg_info.bak $bak/pkg_info.bak2 fi /usr/sbin/pkg_info > $bak/pkg_info.bak if ! cmp -sz $bak/pkg_info.bak $bak/pkg_info.bak2; then echo "" echo "Changes in installed packages:" diff -U 0 $bak/pkg_info.bak2 $bak/pkg_info.bak \ | grep '^[-+][^-+]' | sort -k 1.2 fi fi ;; *) rc=0 ;; esac exit $rc >Release-Note: >Audit-Trail: >Unformatted: