From owner-freebsd-bugs@FreeBSD.ORG Fri May 11 19: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 A4ED616A405 for ; Fri, 11 May 2007 19: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 6417113C455 for ; Fri, 11 May 2007 19:00:11 +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 l4BJ0BYZ000628 for ; Fri, 11 May 2007 19:00:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l4BJ0BPZ000627; Fri, 11 May 2007 19:00:11 GMT (envelope-from gnats) Resent-Date: Fri, 11 May 2007 19:00:11 GMT Resent-Message-Id: <200705111900.l4BJ0BPZ000627@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 9D2D216A409 for ; Fri, 11 May 2007 18:56:31 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 26C1713C4AD for ; Fri, 11 May 2007 18:56:30 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (sxeryj@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l4BIeGPK086850; Fri, 11 May 2007 20:40:21 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l4BIeGGo086849; Fri, 11 May 2007 20:40:16 +0200 (CEST) (envelope-from olli) Message-Id: <200705111840.l4BIeGGo086849@lurza.secnetix.de> Date: Fri, 11 May 2007 20:40:16 +0200 (CEST) From: Oliver Fromme To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Oliver Fromme Subject: conf/112604: New file: /etc/periodic/daily/480.status-ntp 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: Fri, 11 May 2007 19:00:11 -0000 >Number: 112604 >Category: conf >Synopsis: New file: /etc/periodic/daily/480.status-ntp >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: Fri May 11 19:00:10 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: FreeBSD 6.2-STABLE i386 >Organization: secnetix GmbH & Co. KG http://www.secnetix.de/bsd >Environment: FreeBSD 6-stable + 7-current >Description: The script below adds an optional status report for NTP to the daily periodic output. It exits with return code 0 if the local ntpd is successfully synchronized. It exits with return code 1 if the local ntpd is currently not synchronized, or if ntpd isn't running at all, or if it's refusing connections from localhost. >How-To-Repeat: Save the script below as /etc/periodic/daily/480.status-ntp and add this line to /etc/periodic.conf: daily_status_ntp_enable="YES" Suggested default entry for /etc/defaults/periodic.conf: # 480.status-ntp daily_status_ntp_enable="NO" # Check NTP status >Fix: #!/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 rc=0 case "$daily_status_ntp_enable" in [Yy][Ee][Ss]) echo "" echo "NTP status:" synchronized=$(ntpq -p | tee /dev/stderr | grep '^\*') if [ -z "$synchronized" ]; then rc=1 fi ;; esac exit $rc >Release-Note: >Audit-Trail: >Unformatted: