View | Details | Raw Unified | Return to bug 227359
Collapse All | Expand All

(-)./Makefile (-1 / +3 lines)
Lines 1-7 Link Here
1
# $FreeBSD: head/sysutils/phpfpm_exporter/Makefile 462476 2018-02-21 07:49:21Z lwhsu $
1
# $FreeBSD: head/sysutils/phpfpm_exporter/Makefile 462476 2018-02-21 07:49:21Z lwhsu $
2
2
3
PORTNAME=	phpfpm_exporter
3
PORTNAME=	phpfpm_exporter
4
PORTVERSION=	0.3.3
4
PORTVERSION=	0.4.1
5
DISTVERSIONPREFIX=v
5
DISTVERSIONPREFIX=v
6
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
7
7
Lines 19-24 Link Here
19
GO_PKGNAME=	github.com/${GH_ACCOUNT}/${GH_PROJECT}
19
GO_PKGNAME=	github.com/${GH_ACCOUNT}/${GH_PROJECT}
20
PLIST_FILES=	bin/${PORTNAME}
20
PLIST_FILES=	bin/${PORTNAME}
21
USE_RC_SUBR=	phpfpm_exporter
21
USE_RC_SUBR=	phpfpm_exporter
22
USERS=		prometheus
23
GROUPS=		prometheus
22
24
23
do-build:
25
do-build:
24
	@(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} CGO_ENABLED=0 ${GO_CMD} build -o ${PORTNAME} ./cmd/${GH_PROJECT})
26
	@(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} CGO_ENABLED=0 ${GO_CMD} build -o ${PORTNAME} ./cmd/${GH_PROJECT})
(-)./distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1512723537
1
TIMESTAMP = 1523129478
2
SHA256 (bakins-php-fpm-exporter-v0.3.3_GH0.tar.gz) = 02b6ee16d3c595430dd875953639daa95e2b41e9f78e1aca45656e9f5e196b4c
2
SHA256 (bakins-php-fpm-exporter-v0.4.1_GH0.tar.gz) = 1e35ac0254fd897d17d03063604b742405b655f090b79b32b821fe238ff97f4d
3
SIZE (bakins-php-fpm-exporter-v0.3.3_GH0.tar.gz) = 1510300
3
SIZE (bakins-php-fpm-exporter-v0.4.1_GH0.tar.gz) = 300772
(-)./files/phpfpm_exporter.in (-16 / +24 lines)
Lines 9-22 Link Here
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
10
# to enable this service:
10
# to enable this service:
11
#
11
#
12
# phpfpm_exporter_enable (bool):          Set to NO by default.
12
# phpfpm_exporter_enable   (bool):        Set to NO by default.
13
#               Set it to YES to enable phpfpm_exporter.
13
#               Set it to YES to enable phpfpm_exporter.
14
# phpfpm_exporter_user (string):          Set user that phpfpm_exporter will run under
14
# phpfpm_exporter_user     (string):      Set user that phpfpm_exporter will run under
15
#               Default is "nobody".
15
#               Default is "prometheus".
16
# phpfpm_exporter_group (string):         Set group that phpfpm_exporter will run under
16
# phpfpm_exporter_group    (string):      Set group that phpfpm_exporter will run under
17
#               Default is "nobody".
17
#               Default is "prometheus".
18
# phpfpm_exporter_endpoint (string):      Set status endpoint
18
# phpfpm_exporter_endpoint (string):      Set status endpoint
19
#               Default is "http://127.0.0.1:9000/status".
19
#               Default is "http://127.0.0.1:9000/status".
20
# phpfpm_exporter_fastcgi  (string):      Set fastcgi url
21
#               Default is "", If this is set, fastcgi will be used instead of HTTP.
20
# phpfpm_exporter_listen_address (string): Set ip:port that phpfpm_exporter will listen on
22
# phpfpm_exporter_listen_address (string): Set ip:port that phpfpm_exporter will listen on
21
#               Default is "127.0.0.1:8080".
23
#               Default is "127.0.0.1:8080".
22
24
Lines 24-42 Link Here
24
26
25
name=phpfpm_exporter
27
name=phpfpm_exporter
26
rcvar=phpfpm_exporter_enable
28
rcvar=phpfpm_exporter_enable
29
desc="PHP-FPM prometheus exporter"
27
30
28
load_rc_config $name
31
load_rc_config $name
29
32
30
: ${phpfpm_exporter_enable:="NO"}
33
: ${phpfpm_exporter_enable:=NO}
31
: ${phpfpm_exporter_user:="nobody"}
34
: ${phpfpm_exporter_user:=prometheus}
32
: ${phpfpm_exporter_group:="nobody"}
35
: ${phpfpm_exporter_group:=prometheus}
33
: ${phpfpm_exporter_endpoint:="http://127.0.0.1:9000/status"}
36
: ${phpfpm_exporter_endpoint=http://127.0.0.1:9000/status}
34
: ${phpfpm_exporter_listen_address:="127.0.0.1:8080"}
37
: ${phpfpm_exporter_listen_address:=127.0.0.1:8080}
35
38
36
39
37
pidfile=/var/run/phpfpm_exporter.pid
40
pidfile=/var/run/phpfpm_exporter.pid
38
command="/usr/sbin/daemon"
41
command=/usr/sbin/daemon
39
procname="%%PREFIX%%/bin/phpfpm_exporter"
42
procname=%%PREFIX%%/bin/phpfpm_exporter
40
command_args="-p ${pidfile} /usr/bin/env ${procname} \
43
command_args="-p ${pidfile} /usr/bin/env ${procname} \
41
    --addr ${phpfpm_exporter_listen_address} \
44
    --addr ${phpfpm_exporter_listen_address} \
42
    --endpoint ${phpfpm_exporter_endpoint}"
45
    --endpoint ${phpfpm_exporter_endpoint}"
Lines 45-54 Link Here
45
48
46
phpfpm_exporter_startprecmd()
49
phpfpm_exporter_startprecmd()
47
{
50
{
48
    if [ ! -e ${pidfile} ]; then
51
	if [ -n "$phpfpm_exporter_fastcgi" ]; then
49
        install -o ${phpfpm_exporter_user} -g ${phpfpm_exporter_group} /dev/null ${pidfile};
52
		command_args="$command_args --fastcgi $phpfpm_exporter_fastcgi"
50
    fi
53
	fi
54
55
	if [ -e ${pidfile} ]; then
56
		chown ${phpfpm_exporter_user}:${phpfpm_exporter_group} ${pidfile};
57
	else
58
		install -o ${phpfpm_exporter_user} -g ${phpfpm_exporter_group} /dev/null ${pidfile};
59
	fi
51
}
60
}
52
61
53
load_rc_config $name
54
run_rc_command "$1"
62
run_rc_command "$1"

Return to bug 227359