3 # Starts the zabbix_agent2 daemon
7 # description: zabbix_agent2 long service description
9 # processname: zabbix_agent2
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down "Zabbix Agent 2"
27 # Get service config - may override defaults
28 [ -f /etc/sysconfig/zabbix_agent2 ] && . /etc/sysconfig/zabbix_agent2
30 pidfile="/var/run/zabbix/zabbix_agent2.pid"
33 # Check if the service is already running?
34 if [ -f /var/lock/subsys/zabbix_agent2 ]; then
35 msg_already_running "Zabbix Agent 2"
39 msg_starting "Zabbix Agent 2"
40 daemon /usr/sbin/zabbix_agent2
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_agent2
46 if [ ! -f /var/lock/subsys/zabbix_agent2 ]; then
47 msg_not_running "Zabbix Agent 2"
52 msg_stopping "Zabbix Agent 2"
53 killproc --pidfile $pidfile zabbix_agent2 -TERM
54 rm -f /var/lock/subsys/zabbix_agent2
58 if [ ! -f /var/lock/subsys/zabbix_agent2 ]; then
59 msg_not_running "Zabbix Agent 2"
69 # See how we were called.
88 status --pidfile $pidfile zabbix_agent2
92 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"