~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002110857

« back to all changes in this revision

Viewing changes to misc/init.d/suse/9.1/zabbix_suckerd

  • Committer: Bazaar Package Importer
  • Author(s): Michael Ablassmeier
  • Date: 2007-07-02 09:06:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070702090651-8l6fl3fjw9rh6l2u
Tags: 1:1.4.1-2
Add patch from SVN in order to fix Incorrect processing of character '%'
in user parameters and remote commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
# Copyright (c) 07/2004 A.Tophofen, Germany
3
 
#
4
 
# init.d/zabbix_agentd
5
 
#
6
 
### BEGIN INIT INFO
7
 
# Provides:       zabbix_suckerd
8
 
# Required-Start: $network $remote_fs $syslog
9
 
# Required-Stop:
10
 
# Default-Start:  3 
11
 
# Default-Stop:
12
 
# Description:    Starts Zabbix_Agentd
13
 
### END INIT INFO
14
 
 
15
 
. /etc/rc.status
16
 
rc_reset
17
 
NAME="Zabbix_Suckerd"
18
 
CONFIG_FILE="/etc/zabbix/zabbix_suckerd.conf"
19
 
 
20
 
if [ ! -f ${CONFIG_FILE} ]; then
21
 
                echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
22
 
                # Tell the user this has skipped
23
 
                rc_status -s
24
 
                exit 6
25
 
fi
26
 
 
27
 
ZABBIX_BIN="/home/zabbix/bin/zabbix_suckerd"
28
 
ZABBIX_PID="/home/zabbix/lock/zabbix_suckerd.pid"
29
 
 
30
 
 
31
 
if [ ! -x ${ZABBIX_BIN} ] ; then
32
 
        echo -n "${ZABBIX_BIN} not installed! "
33
 
        # Tell the user this has skipped
34
 
        rc_status -s
35
 
        exit 5
36
 
fi
37
 
 
38
 
 
39
 
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/home/zabbix/bin"
40
 
 
41
 
case "$1" in
42
 
    start)
43
 
        echo -n "Starting ${NAME} "
44
 
        checkproc -p ${ZABBIX_PID} ${ZABBIX_BIN}
45
 
        case $? in
46
 
                0) echo -n "- Warning: ${NAME} already running! " ;;
47
 
                1) echo -n "- Warning: ${ZABBIX_PID} exists! " ;;
48
 
        esac
49
 
        
50
 
        startproc -p ${ZABBIX_PID} ${ZABBIX_BIN} -u zabbix
51
 
        rc_status -v
52
 
        ;;
53
 
    stop)
54
 
        echo -n "Shutting down ${NAME}"
55
 
        checkproc -p ${ZABBIX_PID} ${ZABBIX_BIN} || echo -n "- Warning: ${NAME} not running! "
56
 
        killproc -p ${ZABBIX_PID} -TERM ${ZABBIX_BIN}
57
 
        rc_status -v
58
 
        ;;
59
 
    restart)
60
 
        $0 stop
61
 
        $0 start
62
 
        rc_status
63
 
        ;;
64
 
        *)
65
 
        echo "Usage: $0 {start|stop|restart}"
66
 
        exit 1
67
 
        ;;
68
 
esac
69
 
rc_exit
70