svn commit: r378921 - in head/mail/opensmtpd-devel: . files

Ashish SHUKLA ashish at FreeBSD.org
Fri Feb 13 11:51:07 UTC 2015


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"


More information about the svn-ports-all mailing list