Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jan 2021 16:22:03 +0000 (UTC)
From:      Brad Davis <brd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r561925 - in head/textproc/consul-template: . files
Message-ID:  <202101181622.10IGM3CD026093@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brd (src,doc committer)
Date: Mon Jan 18 16:22:03 2021
New Revision: 561925
URL: https://svnweb.freebsd.org/changeset/ports/561925

Log:
  textproc/consul-template: Update rc script to log output to syslog
  
  PR:		252364
  Approved by:	swills

Modified:
  head/textproc/consul-template/Makefile
  head/textproc/consul-template/files/consul-template.in

Modified: head/textproc/consul-template/Makefile
==============================================================================
--- head/textproc/consul-template/Makefile	Mon Jan 18 16:10:00 2021	(r561924)
+++ head/textproc/consul-template/Makefile	Mon Jan 18 16:22:03 2021	(r561925)
@@ -2,6 +2,7 @@
 
 PORTNAME=	consul-template
 PORTVERSION=	0.25.1
+PORTREVISION=	1
 DISTVERSIONPREFIX=	v
 CATEGORIES=	textproc
 

Modified: head/textproc/consul-template/files/consul-template.in
==============================================================================
--- head/textproc/consul-template/files/consul-template.in	Mon Jan 18 16:10:00 2021	(r561924)
+++ head/textproc/consul-template/files/consul-template.in	Mon Jan 18 16:22:03 2021	(r561925)
@@ -19,6 +19,12 @@
 #                                          Default is "".
 # consul_template_args (string):        Set flags used with consul-template.
 #                                          Default is "".
+# consul_template_syslog_output_enable (string): Set to YES to enable syslog output
+#						Default is "NO". See daemon(8).
+# consul_template_syslog_output_priority (str):	Set syslog priority if syslog enabled.
+#						Default is "info". See daemon(8).
+# consul_template_syslog_output_facility (str):	Set syslog facility if syslog enabled.
+#						Default is "daemon". See daemon(8).
 
 . /etc/rc.subr
 
@@ -32,11 +38,23 @@ load_rc_config $name
 : ${consul_template_group:="wheel"}
 : ${consul_template_env:=""}
 : ${consul_template_args:=""}
+: ${consul_template_syslog_output_enable:="NO"}
 
+if checkyesno consul_template_syslog_output_enable; then
+	consul_template_syslog_output_flags="-T ${name}"
+	if [ -n "${consul_template_syslog_output_priority}" ]; then
+		consul_template_syslog_output_flags="${consul_template_syslog_output_flags} -s ${consul_template_syslog_output_priority}"
+	fi
+
+	if [ -n "${consul_template_syslog_output_facility}" ]; then
+		consul_template_syslog_output_flags="${consul_template_syslog_output_flags} -l ${consul_template_syslog_output_facility}"
+	fi
+fi
+
 pidfile=/var/run/consul-template.pid
 procname="%%PREFIX%%/bin/consul-template"
 command="/usr/sbin/daemon"
-command_args="-f -p ${pidfile} /usr/bin/env ${consul_template_env} ${procname} -config=%%PREFIX%%/etc/consul-template.d ${consul_template_args}"
+command_args="-f -t ${name} ${consul_template_syslog_output_flags} -p ${pidfile} /usr/bin/env ${consul_template_env} ${procname} -config=%%PREFIX%%/etc/consul-template.d ${consul_template_args}"
 sig_stop="INT"
 
 start_precmd=consul_template_startprecmd



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