Quellcode durchsuchen

zabbix: switch zabbix_agentd to procd

run tested on ar71xx

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Etienne CHAMPETIER vor 9 Jahren
Ursprung
Commit
f58e0a6407

+ 6
- 16
admin/zabbix/files/zabbix_agentd.init Datei anzeigen

@@ -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
-}

+ 2
- 2
admin/zabbix/patches/010-change-agentd-config.patch Datei anzeigen

@@ -10,8 +10,8 @@
10 10
 -# Mandatory: no
11 11
 -# Default:
12 12
 -# PidFile=/tmp/zabbix_agentd.pid
13
-+# Only /var/run/zabbix_agentd.pid supported
14
-+PidFile=/var/run/zabbix_agentd.pid
13
++# We do not need PidFile with procd
14
++# PidFile=/var/run/zabbix_agentd.pid
15 15
  
16 16
  ### Option: LogFile
17 17
  #	Name of log file.