View | Details | Raw Unified | Return to bug 240882 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/consul/Makefile (-4 / +14 lines)
Lines 1-7 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	consul
3
PORTNAME=	consul
4
PORTVERSION=	1.6.1
4
PORTVERSION=	1.6.2
5
DISTVERSIONPREFIX=	v
5
DISTVERSIONPREFIX=	v
6
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
7
7
Lines 16-22 Link Here
16
USE_GITHUB=	yes
16
USE_GITHUB=	yes
17
GH_ACCOUNT=	hashicorp
17
GH_ACCOUNT=	hashicorp
18
18
19
GO_BUILDFLAGS=	-ldflags="\
19
GO_BUILDFLAGS=	-ldflags=" \
20
		-X github.com/hashicorp/consul/version.Version=${PORTVERSION} \
20
		-X github.com/hashicorp/consul/version.Version=${PORTVERSION} \
21
		-X github.com/hashicorp/consul/version.VersionPrerelease= \
21
		-X github.com/hashicorp/consul/version.VersionPrerelease= \
22
		-X github.com/hashicorp/consul/version.GitDescribe=v${PORTVERSION} \
22
		-X github.com/hashicorp/consul/version.GitDescribe=v${PORTVERSION} \
Lines 26-34 Link Here
26
26
27
PLIST_FILES=	bin/consul
27
PLIST_FILES=	bin/consul
28
28
29
USERS=		consul
29
ETCDIR=			${PREFIX}/etc/${PORTNAME}.d
30
GROUPS=		consul
30
CONSUL_USER?=		consul
31
CONSUL_GROUP?=		consul
32
CONSUL_DATADIR?=	/var/db/${PORTNAME}
31
33
34
USERS=		${CONSUL_USER}
35
GROUPS=		${CONSUL_GROUP}
36
37
SUB_LIST=	ETCDIR=${ETCDIR} \
38
		CONSUL_USER=${CONSUL_USER} \
39
		CONSUL_GROUP=${CONSUL_GROUP} \
40
		CONSUL_DATADIR=${CONSUL_DATADIR}
41
32
post-extract:
42
post-extract:
33
	${MKDIR} ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}
43
	${MKDIR} ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}
34
	${LN} -s ${WRKSRC}/api ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}/api
44
	${LN} -s ${WRKSRC}/api ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}/api
(-)sysutils/consul/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1572039537
1
TIMESTAMP = 1576365597
2
SHA256 (hashicorp-consul-v1.6.1_GH0.tar.gz) = c02a8a9a8b775066cdc33765bbf928f3dd20e3cc0f61cf41f35ed5f0e12a8749
2
SHA256 (hashicorp-consul-v1.6.2_GH0.tar.gz) = 98ba4f3e271536954deb118fe88bfcbd3c6150defeee8a2b946a4dff98594a75
3
SIZE (hashicorp-consul-v1.6.1_GH0.tar.gz) = 22621651
3
SIZE (hashicorp-consul-v1.6.2_GH0.tar.gz) = 22041280
(-)sysutils/consul/files/consul.in (-25 / +68 lines)
Lines 6-52 Link Here
6
# REQUIRE: LOGIN
6
# REQUIRE: LOGIN
7
# KEYWORD: shutdown
7
# KEYWORD: shutdown
8
#
8
#
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
9
# Add consul_enable="YES" to /etc/rc.conf to enable Consul
10
# to enable this service:
11
#
10
#
12
# consul_enable (bool):	Set to NO by default.
11
# Additional variables you can define are:
13
#				Set it to YES to enable consul.
12
#
14
# consul_user (user):        Set user to run consul.
13
# consul_debug (bool)
15
#                               Default is "consul".
14
#     Set it to YES to enable Consul debugging to syslog
16
# consul_group (group):      Set group to run consul.
15
#     Set to NO by default
17
#                               Default is "consul".
16
# consul_user (string)
18
# consul_dir (dir):          Set dir to run consul in.
17
#     Set user that Consul will run under
19
#                               Default is "/var/db/consul".
18
#     Default is "%%CONSUL_USER%%"
19
# consul_group (string)
20
#     Set group that Consul will run under
21
#     Default is "%%CONSUL_GROUP%%"
22
# consul_pidfile (string)
23
#     Set full path to pid file
24
#     Default is "/var/run/consul.pid"
25
# consul_configtest (bool)
26
#     Set it to NO to disable Consul config validation
27
#     Set to YES by default
28
# consul_data_dir (string)
29
#     Set dir to store Consul state
30
#     Default is "%%CONSUL_DATADIR%%"
31
# consul_env (string)
32
#     Set environment variables used with Consul
33
#     Default is ""
34
# consul_args (string)
35
#     Set additional command line arguments
36
#     Default is ""
20
37
21
. /etc/rc.subr
38
. /etc/rc.subr
22
39
23
name=consul
40
name=consul
24
rcvar=consul_enable
41
rcvar=consul_enable
25
extra_commands="reload configtest"
26
42
27
load_rc_config $name
43
load_rc_config $name
28
44
29
: ${consul_enable:="NO"}
45
: ${consul_enable:="NO"}
30
: ${consul_user:="consul"}
46
: ${consul_debug:="NO"}
31
: ${consul_group:="consul"}
47
: ${consul_user:="%%CONSUL_USER%%"}
32
: ${consul_dir:="/var/db/consul"}
48
: ${consul_group:="%%CONSUL_GROUP%%"}
49
: ${consul_pidfile:="/var/run/consul.pid"}
50
: ${consul_configtest:="YES"}
51
: ${consul_datadir:="%%CONSUL_DATADIR%%"}
33
52
34
pidfile=/var/run/consul.pid
53
start_precmd="consul_start_precmd"
54
extra_commands="reload"
55
56
_consul_user=${consul_user}
57
_consul_group=${consul_group}
58
unset consul_user consul_group
59
60
# backwards compatibility
61
if [ -n "${consul_dir}" ]; then
62
	consul_datadir=${consul_dir}
63
fi
64
65
if checkyesno consul_debug; then
66
	consul_syslog_flags="-T ${name}-debug"
67
fi
68
69
if checkyesno consul_configtest; then
70
	restart_precmd="consul_checkconfig"
71
	reload_precmd="consul_checkconfig"
72
	configtest_cmd="consul_checkconfig"
73
	extra_commands="${extra_commands} configtest"
74
fi
75
76
pidfile=${consul_pidfile}
77
35
procname="%%PREFIX%%/bin/consul"
78
procname="%%PREFIX%%/bin/consul"
36
command="/usr/sbin/daemon"
79
command="/usr/sbin/daemon"
37
command_args="-f -p ${pidfile} /usr/bin/env ${consul_env} ${procname} agent -data-dir=${consul_dir} -config-dir=%%PREFIX%%/etc/consul.d ${consul_args}"
80
command_consul="/usr/bin/env ${consul_env} ${procname} agent -data-dir=${consul_datadir} -config-dir=%%ETCDIR%% ${consul_args}"
81
command_args="-f ${consul_syslog_flags} -p ${pidfile} -u ${_consul_user} -t ${name} ${command_consul}"
38
82
39
start_precmd=consul_startprecmd
83
consul_start_precmd()
84
{
85
	install -d -m 0750 -o ${_consul_user} -g ${_consul_group} "%%ETCDIR%%"
86
	install -d -m 0750 -o ${_consul_user} -g ${_consul_group} "${consul_datadir}"
87
}
40
88
41
consul_startprecmd()
89
consul_checkconfig()
42
{
90
{
43
        if [ ! -e ${pidfile} ]; then
91
	echo "Performing sanity check on ${name} configuration:"
44
                install -o ${consul_user} -g ${consul_group} /dev/null ${pidfile};
92
	eval ${procname} validate "%%ETCDIR%%"
45
        fi
46
47
        if [ ! -d ${consul_dir} ]; then
48
                install -d -o ${consul_user} -g ${consul_group} ${consul_dir}
49
        fi
50
}
93
}
51
94
52
run_rc_command "$1"
95
run_rc_command "$1"

Return to bug 240882