diff options
author | Steve Wills <swills@FreeBSD.org> | 2016-08-10 15:31:45 +0000 |
---|---|---|
committer | Steve Wills <swills@FreeBSD.org> | 2016-08-10 15:31:45 +0000 |
commit | 5a7483b4229e3e109ad53349e9ce6abaaafeca16 (patch) | |
tree | 34d5d5e1532cf92d892455e633d9d50288c37555 /textproc/consul-template/files | |
parent | 4abdcf3da9b76336aaebc33f49937019676e42a9 (diff) | |
download | ports-5a7483b4229e3e109ad53349e9ce6abaaafeca16.tar.gz ports-5a7483b4229e3e109ad53349e9ce6abaaafeca16.zip |
Notes
Diffstat (limited to 'textproc/consul-template/files')
-rw-r--r-- | textproc/consul-template/files/consul-template.in | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/textproc/consul-template/files/consul-template.in b/textproc/consul-template/files/consul-template.in new file mode 100644 index 000000000000..1309b1d203c4 --- /dev/null +++ b/textproc/consul-template/files/consul-template.in @@ -0,0 +1,50 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: consul_template +# REQUIRE: LOGIN +# KEYWORD: shtudown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# consul_template_enable (bool): Set to NO by default. +# Set it to YES to enable consul-template. +# consul_template_user (user): Set user to run consul-template. +# Default is "root". +# consul_template_group (group): Set group to run consul-template. +# Default is "wheel". +# consul_template_env (string): Set environment variables used with consul-template. +# Default is "". +# consul_template_args (string): Set flags used with consul-template. +# Default is "". + +. /etc/rc.subr + +name=consul_template +rcvar=consul_template_enable + +load_rc_config $name + +: ${consul_template_enable:="NO"} +: ${consul_template_user:="root"} +: ${consul_template_group:="wheel"} +: ${consul_template_env:=""} +: ${consul_template_args:=""} + +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}" + +start_precmd=consul_template_startprecmd + +consul_template_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${consul_template_user} -g ${consul_template_group} /dev/null ${pidfile} + fi +} + +run_rc_command "$1" |