aboutsummaryrefslogtreecommitdiffstats
path: root/textproc
diff options
context:
space:
mode:
authorBrad Davis <brd@FreeBSD.org>2021-01-19 00:22:03 +0800
committerBrad Davis <brd@FreeBSD.org>2021-01-19 00:22:03 +0800
commitf1e8be62e5a2f0a1a60f4ed29cfa6ac8f8be30f6 (patch)
tree5be2f28d7d07a6092e62e8f27cefa754fcb9269d /textproc
parent76ba930552368af9552f513e245413a6a75cbcb2 (diff)
downloadfreebsd-ports-gnome-f1e8be62e5a2f0a1a60f4ed29cfa6ac8f8be30f6.tar.gz
freebsd-ports-gnome-f1e8be62e5a2f0a1a60f4ed29cfa6ac8f8be30f6.tar.zst
freebsd-ports-gnome-f1e8be62e5a2f0a1a60f4ed29cfa6ac8f8be30f6.zip
textproc/consul-template: Update rc script to log output to syslog
PR: 252364 Approved by: swills
Diffstat (limited to 'textproc')
-rw-r--r--textproc/consul-template/Makefile1
-rw-r--r--textproc/consul-template/files/consul-template.in20
2 files changed, 20 insertions, 1 deletions
diff --git a/textproc/consul-template/Makefile b/textproc/consul-template/Makefile
index 8c8665b85bec..c7dc081ee146 100644
--- a/textproc/consul-template/Makefile
+++ b/textproc/consul-template/Makefile
@@ -2,6 +2,7 @@
PORTNAME= consul-template
PORTVERSION= 0.25.1
+PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= textproc
diff --git a/textproc/consul-template/files/consul-template.in b/textproc/consul-template/files/consul-template.in
index 696962b6be29..d8fb7a73423a 100644
--- a/textproc/consul-template/files/consul-template.in
+++ b/textproc/consul-template/files/consul-template.in
@@ -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