Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Apr 2018 14:18:46 +0000 (UTC)
From:      Ben Woods <woodsb02@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r468629 - in branches/2018Q2/sysutils/zrepl: . files
Message-ID:  <201804291418.w3TEIkuZ096575@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: woodsb02
Date: Sun Apr 29 14:18:46 2018
New Revision: 468629
URL: https://svnweb.freebsd.org/changeset/ports/468629

Log:
  MFH: r468402
  
  sysutils/zrepl: Fix rc.d init script on FreeBSD < 11.1
  
  This change removes the daemon syslog feature on FreeBSD < 11.1.
  This has little effect to the usefulness of zrepl logging, as the daemon
  itself has inbuilt syslog support which is enabled by default in the
  sample config file /usr/local/etc/zrepl/zrepl.yml. The only output to
  stdout/stderr from zrepl will be if its inbuilt syslog feature is not
  working.
  
  PR:		224844
  Reported by:	Bernhard <bernhard.kneip@postadigitale.de>
  
  Approved by:	ports-secteam (riggs)

Modified:
  branches/2018Q2/sysutils/zrepl/Makefile
  branches/2018Q2/sysutils/zrepl/files/zrepl.in
Directory Properties:
  branches/2018Q2/   (props changed)

Modified: branches/2018Q2/sysutils/zrepl/Makefile
==============================================================================
--- branches/2018Q2/sysutils/zrepl/Makefile	Sun Apr 29 13:35:08 2018	(r468628)
+++ branches/2018Q2/sysutils/zrepl/Makefile	Sun Apr 29 14:18:46 2018	(r468629)
@@ -3,6 +3,7 @@
 
 PORTNAME=	zrepl
 PORTVERSION=	0.0.2
+PORTREVISION=	1
 CATEGORIES=	sysutils
 
 MAINTAINER=	woodsb02@FreeBSD.org
@@ -35,6 +36,14 @@ GH_TUPLE=	davecgh:go-spew:v1.1.0:go_spew/src/github.co
 
 GO_PKGNAME=	github.com/${GH_ACCOUNT}/${GH_PROJECT}
 
+.include <bsd.port.pre.mk>
+
+.if ${OPSYS} == "FreeBSD" && ((${OSVERSION} >= 1100513 && ${OSVERSION} < 1200000) || ${OSVERSION} >= 1200015)
+SUB_LIST+=	DAEMON_LOGGING="-S -l \$${zrepl_facility} -s \$${zrepl_priority} -T \$${name}"
+.else
+SUB_LIST+=	DAEMON_LOGGING=""
+.endif
+
 post-extract:
 	${LN} -sf ${WRKSRC}/src ${WRKDIR}
 
@@ -49,4 +58,4 @@ post-install:
 	${INSTALL_DATA} ${FILESDIR}/syslog-zrepl.conf.sample ${STAGEDIR}${PREFIX}/etc/syslog.d/zrepl.conf.sample
 	${INSTALL_DATA} ${FILESDIR}/zrepl.yml.sample ${STAGEDIR}${PREFIX}/etc/zrepl/zrepl.yml.sample
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Modified: branches/2018Q2/sysutils/zrepl/files/zrepl.in
==============================================================================
--- branches/2018Q2/sysutils/zrepl/files/zrepl.in	Sun Apr 29 13:35:08 2018	(r468628)
+++ branches/2018Q2/sysutils/zrepl/files/zrepl.in	Sun Apr 29 14:18:46 2018	(r468629)
@@ -9,18 +9,24 @@
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
 # to enable this service:
 #
-# zrepl_enable:		Set to YES to enable the zrepl service.
+# zrepl_enable (bool):	Set to YES to enable the zrepl service.
 #			Default: NO
-# zrepl_config:		File containing zrepl configuration details.
+# zrepl_config (str):	File containing zrepl configuration details.
 #			Default: %%PREFIX%%/etc/zrepl/zrepl.yml
-# zrepl_user:		The user account used to run the zrepl daemon.
+# zrepl_user (str):	The user account used to run the zrepl daemon.
 #			Do not specifically set this to an empty string as this
 #			will cause the daemon to run as root.
 #			Default: root
-# zrepl_group:		The group account used to run the zrepl daemon.
+# zrepl_group (str):	The group account used to run the zrepl daemon.
 #			Do not specifically set this to an empty string as this
 #			will cause the daemon to run with group wheel.
 #			Default: wheel
+# zrepl_flags (str):	Extra flags passed to zrepl
+#			Default: ""
+# zrepl_facility (str):	Syslog facility to use
+#			Default: local0
+# zrepl_priority (str):	Syslog priority to use
+#			Default: alert
 
 . /etc/rc.subr
 name=zrepl
@@ -31,13 +37,19 @@ load_rc_config $name
 : ${zrepl_config:="%%PREFIX%%/etc/zrepl/zrepl.yml"}
 : ${zrepl_user:="root"}
 : ${zrepl_group:="wheel"}
+: ${zrepl_flags:=""}
+: ${zrepl_facility:="local0"}
+: ${zrepl_priority:="alert"}
+: ${zrepl_options:="${zrepl_flags} --config ${zrepl_config} daemon"}
 
 pidfile="/var/run/zrepl/daemon.pid"
 command="/usr/sbin/daemon"
 procname="%%PREFIX%%/bin/zrepl"
-command_args="-p ${pidfile} -S -l local0 -s alert -T zrepl ${procname} --config ${zrepl_config} daemon"
+command_args="-p ${pidfile} %%DAEMON_LOGGING%% ${procname} ${zrepl_options}"
 
 start_precmd=zrepl_precmd
+stop_postcmd=zrepl_postcmd
+
 zrepl_precmd()
 {
 	if [ ! -d "/var/run/zrepl/stdinserver" ]; then
@@ -50,7 +62,6 @@ zrepl_precmd()
 	fi
 }
 
-stop_postcmd=zrepl_postcmd
 zrepl_postcmd()
 {
 	rm -f -- "${pidfile}"



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