Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jun 2016 15:47:58 +0000 (UTC)
From:      Adam Weinberger <adamw@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r416613 - in head/net/openntpd: . files
Message-ID:  <201606091547.u59Flwr1029912@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606091547.u59Flwr1029912>