|
@@ -3,29 +3,19 @@
|
3
|
3
|
|
4
|
4
|
START=60
|
5
|
5
|
|
|
6
|
+USE_PROCD=1
|
6
|
7
|
PROG=/usr/sbin/zabbix_agentd
|
7
|
8
|
CONFIG=/etc/zabbix_agentd.conf
|
8
|
|
-SERVICE_PID_FILE=/var/run/zabbix_agentd.pid
|
9
|
9
|
|
10
|
|
-start() {
|
|
10
|
+start_service() {
|
11
|
11
|
# Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf
|
12
|
12
|
[ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG}
|
13
|
13
|
|
14
|
14
|
[ -f ${CONFIG} ] || return 1
|
15
|
15
|
|
16
|
|
- grep -q "^PidFile=${SERVICE_PID_FILE}" ${CONFIG} || {
|
17
|
|
- logger -s -t ${CONFIG} -p daemon.error "Only \"PidFile=${SERVICE_PID_FILE}\" supported"
|
18
|
|
- return 1
|
19
|
|
- }
|
20
|
|
-
|
21
|
|
- grep -q "^AllowRoot=1" ${CONFIG} || {
|
22
|
|
- touch ${SERVICE_PID_FILE}
|
23
|
|
- chown zabbix:zabbix ${SERVICE_PID_FILE}
|
24
|
|
- }
|
25
|
|
-
|
26
|
|
- service_start ${PROG} -c ${CONFIG}
|
|
16
|
+ procd_open_instance
|
|
17
|
+ procd_set_param command ${PROG} -c ${CONFIG} -f
|
|
18
|
+ procd_set_param respawn
|
|
19
|
+ procd_close_instance
|
27
|
20
|
}
|
28
|
21
|
|
29
|
|
-stop() {
|
30
|
|
- service_stop ${PROG}
|
31
|
|
-}
|