updated on Wed Jan 11 00:07:16 UTC 2012
[aur-mirror.git] / zabbix-agent / zabbix-agentd
blobb3ec78c5961a136f3f93a4339b01d0b8799b025e
1 #!/bin/bash
3 # Source function library.
4 . /etc/rc.conf
5 . /etc/rc.d/functions
8 start () {
9 stat_busy "Starting zabbix-agent"
10 mkdir -p /var/log/zabbix
11 mkdir -p /var/run/zabbix
12 chown -R zabbix:zabbix /var/log/zabbix /var/run/zabbix
13 /usr/sbin/zabbix_agentd &>/dev/null
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon zabbix_agentd
18 stat_done
22 stop() {
23 stat_busy "Stopping zabbix-agent"
24 killall zabbix_agentd
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon zabbix_agentd
29 stat_done
33 # See how we were called.
34 case $1 in
35 start)
36 start
38 stop)
39 stop
41 restart)
42 stop
43 start
46 echo $"Usage: zabbix-agent {start|stop|restart}"
47 exit 1
48 esac
50 exit $RETVAL