From owner-svn-ports-all@freebsd.org Thu Jun 9 15:48:00 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C243AEFE69; Thu, 9 Jun 2016 15:48:00 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 C3E7C1F02; Thu, 9 Jun 2016 15:47:59 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59FlwrC029914; Thu, 9 Jun 2016 15:47:58 GMT (envelope-from adamw@FreeBSD.org) Received: (from adamw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Flwr1029912; Thu, 9 Jun 2016 15:47:58 GMT (envelope-from adamw@FreeBSD.org) Message-Id: <201606091547.u59Flwr1029912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adamw set sender to adamw@FreeBSD.org using -f From: Adam Weinberger Date: Thu, 9 Jun 2016 15:47:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r416613 - in head/net/openntpd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 15:48:00 -0000 Author: adamw Date: Thu Jun 9 15:47:58 2016 New Revision: 416613 URL: https://svnweb.freebsd.org/changeset/ports/416613 Log: Add support for changing the location of ntpd.conf (openntpd_config), and add a 'configtest' rc(8) target. Also note openntpd_flags in the comments at the top of the rc(8) script. PORTREVISION bump for rc(8) script change. PR: 210153 Approved by: naddy (maintainer) Modified: head/net/openntpd/Makefile head/net/openntpd/files/openntpd.in Modified: head/net/openntpd/Makefile ============================================================================== --- head/net/openntpd/Makefile Thu Jun 9 15:30:07 2016 (r416612) +++ head/net/openntpd/Makefile Thu Jun 9 15:47:58 2016 (r416613) @@ -2,6 +2,7 @@ PORTNAME= openntpd PORTVERSION= 6.0p1 +PORTREVISION= 1 PORTEPOCH= 2 CATEGORIES= net MASTER_SITES= OPENBSD/OpenNTPD Modified: head/net/openntpd/files/openntpd.in ============================================================================== --- head/net/openntpd/files/openntpd.in Thu Jun 9 15:30:07 2016 (r416612) +++ head/net/openntpd/files/openntpd.in Thu Jun 9 15:47:58 2016 (r416613) @@ -12,22 +12,39 @@ # # openntpd_enable (bool): Set to NO by default. # Set it to YES to enable openntpd. +# openntpd_config (str): Path to ntpd.conf +# Default: %%PREFIX%%/etc/ntpd.conf +# openntpd_flags (str): Flags passed to ntpd(8) +# Default: none . /etc/rc.subr -check_process() -{ - pgrep -f $command -} - name=openntpd rcvar=openntpd_enable -command=%%PREFIX%%/sbin/ntpd -required_files=%%PREFIX%%/etc/ntpd.conf +start_precmd="openntpd_checkconfig" +restart_precmd="openntpd_checkconfig" +configtest_cmd="openntpd_checkconfig" +extra_commands="configtest" load_rc_config $name -: ${openntpd_enable="NO"} +: ${openntpd_enable:="NO"} +: ${openntpd_config:="%%PREFIX%%/etc/ntpd.conf"} + +command=%%PREFIX%%/sbin/ntpd +command_args="-f ${openntpd_config}" +required_files=${openntpd_config} + +check_process() +{ + pgrep -f $command +} + +openntpd_checkconfig() +{ + echo "Performing sanity check on ${name} configuration:" + eval ${command} ${command_args} ${openntpd_flags} -n +} run_rc_command "$1"