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

Collapse All | Expand All

(-)zabbix2-server/Makefile (+15 lines)
Lines 148-153 Link Here
148
		${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in
148
		${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in
149
	@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) -exec ${RM} -f {} +
149
	@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) -exec ${RM} -f {} +
150
150
151
.if ${ZABBIX_BUILD} == "server"
152
	@${REINPLACE_CMD} -e 's#PidFile=/tmp/zabbix_server.pid#PidFile=/var/run/zabbix/zabbix_server.pid#g' \
153
		${WRKSRC}/conf/zabbix_server*.conf
154
.endif
155
156
.if ${ZABBIX_BUILD} == "proxy"
157
	@${REINPLACE_CMD} -e 's#PidFile=/tmp/zabbix_proxy.pid#PidFile=/var/run/zabbix/zabbix_proxy.pid#g' \
158
		${WRKSRC}/conf/zabbix_proxy*.conf
159
.endif
160
161
.if ${ZABBIX_BUILD} == "agent"
162
	@${REINPLACE_CMD} -e 's#PidFile=/tmp/zabbix_agentd.pid#PidFile=/var/run/zabbix/zabbix_agentd.pid#g' \
163
		${WRKSRC}/conf/zabbix_agentd.conf
164
.endif
165
151
post-install:
166
post-install:
152
.if ${PORT_OPTIONS:MJAVAGW}
167
.if ${PORT_OPTIONS:MJAVAGW}
153
	@${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample
168
	@${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample
(-)zabbix2-server/files/patch-src-zabbix_agent_zabbix_agentd.c (+11 lines)
Line 0 Link Here
1
--- src/zabbix_agent/zabbix_agentd.c.orig	2016-05-13 14:37:25.696606000 +0300
2
+++ src/zabbix_agent/zabbix_agentd.c	2016-05-13 14:49:45.011554761 +0300
3
@@ -521,7 +521,7 @@
4
 		CONFIG_LOAD_MODULE_PATH = zbx_strdup(CONFIG_LOAD_MODULE_PATH, LIBDIR "/modules");
5
 
6
 	if (NULL == CONFIG_PID_FILE)
7
-		CONFIG_PID_FILE = "/tmp/zabbix_agentd.pid";
8
+		CONFIG_PID_FILE = "/var/run/zabbix/zabbix_agentd.pid";
9
 #endif
10
 	if (NULL == CONFIG_LOG_TYPE_STR)
11
 		CONFIG_LOG_TYPE_STR = zbx_strdup(CONFIG_LOG_TYPE_STR, ZBX_OPTION_LOGTYPE_FILE);
(-)zabbix2-server/files/patch-src-zabbix_proxy_proxy.c (+11 lines)
Line 0 Link Here
1
--- src/zabbix_proxy/proxy.c.orig	2016-04-20 12:51:20.000000000 +0300
2
+++ src/zabbix_proxy/proxy.c	2016-05-13 14:46:44.193569184 +0300
3
@@ -389,7 +389,7 @@
4
 		CONFIG_SNMPTRAP_FILE = zbx_strdup(CONFIG_SNMPTRAP_FILE, "/tmp/zabbix_traps.tmp");
5
 
6
 	if (NULL == CONFIG_PID_FILE)
7
-		CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/tmp/zabbix_proxy.pid");
8
+		CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/var/run/zabbix/zabbix_proxy.pid");
9
 
10
 	if (NULL == CONFIG_TMPDIR)
11
 		CONFIG_TMPDIR = zbx_strdup(CONFIG_TMPDIR, "/tmp");
(-)zabbix2-server/files/patch-src-zabbix_server_server.c (+11 lines)
Line 0 Link Here
1
--- src/zabbix_server/server.c.orig	2016-04-20 12:51:20.000000000 +0300
2
+++ src/zabbix_server/server.c	2016-05-13 14:20:17.603677788 +0300
3
@@ -369,7 +369,7 @@
4
 		CONFIG_SNMPTRAP_FILE = zbx_strdup(CONFIG_SNMPTRAP_FILE, "/tmp/zabbix_traps.tmp");
5
 
6
 	if (NULL == CONFIG_PID_FILE)
7
-		CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/tmp/zabbix_server.pid");
8
+		CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/var/run/zabbix/zabbix_server.pid");
9
 
10
 	if (NULL == CONFIG_ALERT_SCRIPTS_PATH)
11
 		CONFIG_ALERT_SCRIPTS_PATH = zbx_strdup(CONFIG_ALERT_SCRIPTS_PATH, DATADIR "/zabbix/alertscripts");
(-)zabbix2-server/files/zabbix_agentd.in (-12 / +15 lines)
Lines 9-18 Link Here
9
#
9
#
10
# zabbix_agentd_enable (bool): Set to NO by default.  Set it to YES to
10
# zabbix_agentd_enable (bool): Set to NO by default.  Set it to YES to
11
#         enable zabbix_agentd.
11
#         enable zabbix_agentd.
12
# zabbix_agentd_paths (string): Set to standard path by default.  Set a search
13
#         if you have custom userparams that need binaries elsewhere.
14
# zabbix_agentd_config (string): Set to the standard config file path by
12
# zabbix_agentd_config (string): Set to the standard config file path by
15
#         default.
13
#         default.
14
# zabbix_agentd_pidfile (string):    Location of the asterisk pid file
15
#                               Default is /var/run/zabbix/zabbix_agentd.pid
16
#
16
#
17
17
18
. /etc/rc.subr
18
. /etc/rc.subr
Lines 22-43 Link Here
22
22
23
load_rc_config $name
23
load_rc_config $name
24
24
25
: ${zabbix_agentd_enable="NO"}
25
: ${zabbix_agentd_enable:=NO}
26
: ${zabbix_agentd_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin}
26
: ${zabbix_agentd_config:=%%ETCDIR%%/${name}.conf}
27
: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"}
27
: ${zabbix_agentd_pidfile:=/var/run/zabbix/zabbix_agentd.pid}
28
28
29
command="%%PREFIX%%/sbin/${name}"
29
command="%%PREFIX%%/sbin/${name}"
30
required_files="${zabbix_agentd_config}"
30
required_files="${zabbix_agentd_config}"
31
start_precmd="find_pidfile"
32
status_precmd="find_pidfile"
33
stop_precmd="find_pidfile"
34
31
35
find_pidfile()
32
start_precmd=zabbix_agentd_precmd 
33
status_precmd=zabbix_agentd_precmd
34
stop_precmd=zabbix_agentd_precmd
35
36
zabbix_agentd_precmd()
36
{
37
{
37
	if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then
38
	if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then
38
		pidfile="$_pidfile_from_conf"
39
		pidfile="$_pidfile_from_conf"
39
	else
40
	else
40
		pidfile="/tmp/${name}.pid"
41
		pidfile=${zabbix_agentd_pidfile}
42
		local rundir=${zabbix_agentd_pidfile%/*}
43
		if [ ! -d $rundir ] ; then
44
			install -d -m 0755 -o zabbix -g zabbix $rundir
45
		fi
41
	fi
46
	fi
42
47
43
	# This shouldn't be necessary with pidfile, but empirically it was the
48
	# This shouldn't be necessary with pidfile, but empirically it was the
Lines 47-52 Link Here
47
	rc_pid=$(check_pidfile ${pidfile} ${command})
52
	rc_pid=$(check_pidfile ${pidfile} ${command})
48
}
53
}
49
54
50
export PATH="${zabbix_agentd_paths}"
51
52
run_rc_command "$1"
55
run_rc_command "$1"
(-)zabbix2-server/files/zabbix_proxy.in (-12 / +17 lines)
Lines 1-7 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
2
3
# PROVIDE: zabbix_proxy
3
# PROVIDE: zabbix_proxy
4
# REQUIRE: DAEMON%%ZABBIX_REQUIRE%%
4
# REQUIRE: DAEMON
5
%%PGSQL%%# REQUIRE: postgresql
6
%%MYSQL%%# REQUIRE: mysql-server
5
# KEYWORD: shutdown
7
# KEYWORD: shutdown
6
#
8
#
7
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
Lines 9-18 Link Here
9
#
11
#
10
# zabbix_proxy_enable (bool): Set to NO by default.  Set it to YES to
12
# zabbix_proxy_enable (bool): Set to NO by default.  Set it to YES to
11
#         enable zabbix_proxy.
13
#         enable zabbix_proxy.
12
# zabbix_proxy_paths (string): Set to standard path by default.  Set a search
13
#         if you have custom externals that need binaries elsewhere.
14
# zabbix_proxy_config (string): Set to the standard config file path by
14
# zabbix_proxy_config (string): Set to the standard config file path by
15
#         default.
15
#         default.
16
# zabbix_proxy_pidfile (string):    Location of the asterisk pid file
17
#                               Default is /var/run/zabbix/zabbix_proxy.pid
16
#
18
#
17
19
18
. /etc/rc.subr
20
. /etc/rc.subr
Lines 22-43 Link Here
22
24
23
load_rc_config $name
25
load_rc_config $name
24
26
25
: ${zabbix_proxy_enable="NO"}
27
: ${zabbix_proxy_enable:=NO}
26
: ${zabbix_proxy_config="%%ETCDIR%%/${name}.conf"}
28
: ${zabbix_proxy_config:=%%ETCDIR%%/${name}.conf}
29
: ${zabbix_proxy_pidfile:=/var/run/zabbix/zabbix_proxy.pid}
27
30
28
command="%%PREFIX%%/sbin/${name}"
31
command="%%PREFIX%%/sbin/${name}"
29
required_files="${zabbix_proxy_config}"
32
required_files="${zabbix_proxy_config}"
30
start_precmd="find_pidfile"
31
status_precmd="find_pidfile"
32
stop_precmd="find_pidfile"
33
33
34
start_precmd=zabbix_proxy_precmd 
35
status_precmd=zabbix_proxy_precmd
36
stop_precmd=zabbix_proxy_precmd
34
37
35
find_pidfile()
38
zabbix_proxy_precmd()
36
{
39
{
37
	if get_pidfile_from_conf PidFile ${zabbix_proxy_config}; then
40
	if get_pidfile_from_conf PidFile ${zabbix_proxy_config}; then
38
		pidfile="$_pidfile_from_conf"
41
		pidfile="$_pidfile_from_conf"
39
	else
42
	else
40
		pidfile="/tmp/${name}.pid"
43
		pidfile=${zabbix_proxy_pidfile}
44
		local rundir=${zabbix_proxy_pidfile%/*}
45
		if [ ! -d $rundir ] ; then
46
			install -d -m 0755 -o zabbix -g zabbix $rundir
47
		fi
41
	fi
48
	fi
42
49
43
	# This shouldn't be necessary with pidfile, but empirically it was the
50
	# This shouldn't be necessary with pidfile, but empirically it was the
Lines 47-52 Link Here
47
	rc_pid=$(check_pidfile ${pidfile} ${command})
54
	rc_pid=$(check_pidfile ${pidfile} ${command})
48
}
55
}
49
56
50
export PATH="${zabbix_proxy_paths}"
51
52
run_rc_command "$1"
57
run_rc_command "$1"
(-)zabbix2-server/files/zabbix_server.in (-14 / +19 lines)
Lines 1-7 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
2
3
# PROVIDE: zabbix_server
3
# PROVIDE: zabbix_server
4
# REQUIRE: DAEMON%%ZABBIX_REQUIRE%%
4
# REQUIRE: DAEMON
5
%%PGSQL%%# REQUIRE: postgresql
6
%%MYSQL%%# REQUIRE: mysql-server
5
# KEYWORD: shutdown
7
# KEYWORD: shutdown
6
#
8
#
7
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
Lines 9-18 Link Here
9
#
11
#
10
# zabbix_server_enable (bool): Set to NO by default.  Set it to YES to
12
# zabbix_server_enable (bool): Set to NO by default.  Set it to YES to
11
#         enable zabbix_server.
13
#         enable zabbix_server.
12
# zabbix_server_paths (string): Set to standard path by default.  Set a search
13
#         if you have custom externals that need binaries elsewhere.
14
# zabbix_server_config (string): Set to the standard config file path by
14
# zabbix_server_config (string): Set to the standard config file path by
15
#         default.
15
#         default.
16
# zabbix_server_pidfile (string):    Location of the asterisk pid file
17
#                               Default is /var/run/zabbix/zabbix_server.pid
16
#
18
#
17
19
18
. /etc/rc.subr
20
. /etc/rc.subr
Lines 22-43 Link Here
22
24
23
load_rc_config $name
25
load_rc_config $name
24
26
25
: ${zabbix_server_enable="NO"}
27
: ${zabbix_server_enable:=NO}
26
: ${zabbix_server_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin}
28
: ${zabbix_server_config:=%%ETCDIR%%/${name}.conf}
27
: ${zabbix_server_config="%%ETCDIR%%/${name}.conf"}
29
: ${zabbix_server_pidfile:=/var/run/zabbix/zabbix_server.pid}
28
30
29
command="%%PREFIX%%/sbin/${name}"
31
command="%%PREFIX%%/sbin/${name}"
30
required_files="${zabbix_server_config}"
32
required_files="${zabbix_server_config}"
31
start_precmd="find_pidfile"
32
status_precmd="find_pidfile"
33
stop_precmd="find_pidfile"
34
33
35
find_pidfile()
34
start_precmd=zabbix_server_precmd 
35
status_precmd=zabbix_server_precmd
36
stop_precmd=zabbix_server_precmd
37
38
zabbix_server_precmd()
36
{
39
{
37
	if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then
40
	if get_pidfile_from_conf PidFile ${zabbix_server_config}; then
38
		pidfile="$_pidfile_from_conf"
41
		pidfile="$_pidfile_from_conf"
39
	else
42
	else
40
		pidfile="/tmp/${name}.pid"
43
		pidfile=${zabbix_server_pidfile}
44
		local rundir=${zabbix_server_pidfile%/*}
45
		if [ ! -d $rundir ] ; then
46
			install -d -m 0755 -o zabbix -g zabbix $rundir
47
		fi
41
	fi
48
	fi
42
49
43
	# This shouldn't be necessary with pidfile, but empirically it was the
50
	# This shouldn't be necessary with pidfile, but empirically it was the
Lines 47-52 Link Here
47
	rc_pid=$(check_pidfile ${pidfile} ${command})
54
	rc_pid=$(check_pidfile ${pidfile} ${command})
48
}
55
}
49
56
50
export PATH="${zabbix_server_paths}"
51
52
run_rc_command "$1"
57
run_rc_command "$1"

Return to bug 209890