diff options
author | Etienne CHAMPETIER <champetier.etienne@gmail.com> | 2015-06-21 16:10:34 +0200 |
---|---|---|
committer | Etienne CHAMPETIER <champetier.etienne@gmail.com> | 2015-07-11 00:26:30 +0200 |
commit | f58e0a640714fee335065670be34e174f4814bd9 (patch) | |
tree | 1014243b56ead6688926445c82547da2d5f3123c /admin/zabbix/files | |
parent | e3576f3d0f34b7e13167f8d368fa8c311eda35b9 (diff) |
zabbix: switch zabbix_agentd to procd
run tested on ar71xx
Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Diffstat (limited to 'admin/zabbix/files')
-rwxr-xr-x[-rw-r--r--] | admin/zabbix/files/zabbix_agentd.init | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/admin/zabbix/files/zabbix_agentd.init b/admin/zabbix/files/zabbix_agentd.init index c806a9f0b..86f1cedea 100644..100755 --- a/admin/zabbix/files/zabbix_agentd.init +++ b/admin/zabbix/files/zabbix_agentd.init @@ -3,29 +3,19 @@ START=60 +USE_PROCD=1 PROG=/usr/sbin/zabbix_agentd CONFIG=/etc/zabbix_agentd.conf -SERVICE_PID_FILE=/var/run/zabbix_agentd.pid -start() { +start_service() { # Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf [ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG} [ -f ${CONFIG} ] || return 1 - grep -q "^PidFile=${SERVICE_PID_FILE}" ${CONFIG} || { - logger -s -t ${CONFIG} -p daemon.error "Only \"PidFile=${SERVICE_PID_FILE}\" supported" - return 1 - } - - grep -q "^AllowRoot=1" ${CONFIG} || { - touch ${SERVICE_PID_FILE} - chown zabbix:zabbix ${SERVICE_PID_FILE} - } - - service_start ${PROG} -c ${CONFIG} + procd_open_instance + procd_set_param command ${PROG} -c ${CONFIG} -f + procd_set_param respawn + procd_close_instance } -stop() { - service_stop ${PROG} -} |