Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Feb 2015 11:51:07 +0000 (UTC)
From:      Ashish SHUKLA <ashish@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r378921 - in head/mail/opensmtpd-devel: . files
Message-ID:  <201502131151.t1DBp7Iu025652@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ashish
Date: Fri Feb 13 11:51:06 2015
New Revision: 378921
URL: https://svnweb.freebsd.org/changeset/ports/378921
QAT: https://qat.redports.org/buildarchive/r378921/

Log:
  - Update rc.d script to add a configtest command to test configuration
    before starting/restarting service.
  
  PR:		197587
  Submitted by:	elbarto at megadrive.org

Modified:
  head/mail/opensmtpd-devel/Makefile
  head/mail/opensmtpd-devel/files/smtpd.in

Modified: head/mail/opensmtpd-devel/Makefile
==============================================================================
--- head/mail/opensmtpd-devel/Makefile	Fri Feb 13 11:33:45 2015	(r378920)
+++ head/mail/opensmtpd-devel/Makefile	Fri Feb 13 11:51:06 2015	(r378921)
@@ -3,6 +3,7 @@
 
 PORTNAME=	opensmtpd
 PORTVERSION=	201502012312
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	mail
 MASTER_SITES=	http://www.opensmtpd.org/archives/ \

Modified: head/mail/opensmtpd-devel/files/smtpd.in
==============================================================================
--- head/mail/opensmtpd-devel/files/smtpd.in	Fri Feb 13 11:33:45 2015	(r378920)
+++ head/mail/opensmtpd-devel/files/smtpd.in	Fri Feb 13 11:51:06 2015	(r378921)
@@ -26,6 +26,11 @@ check_process()
 name="smtpd"
 rcvar=smtpd_enable
 
+start_precmd="smtpd_precmd"
+restart_precmd="smtpd_checkconfig"
+configtest_cmd="smtpd_checkconfig"
+extra_commands="configtest"
+
 load_rc_config $name
 
 : ${smtpd_enable:="NO"}
@@ -37,4 +42,15 @@ command=${smtpd_procname}
 
 procname=${smtpd_procname}
 
+smtpd_checkconfig()
+{
+    echo "Performing sanity check on smtpd configuration:"
+    eval ${command} ${smtpd_flags} -n
+}
+
+smtpd_precmd()
+{
+    smtpd_checkconfig
+}
+
 run_rc_command "$1"



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