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

« back to all changes in this revision

Viewing changes to debian/zabbix-agent.init

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-06-04 09:22:37 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080604092237-zgwq7kmraj1oohoz
Tags: 1:1.4.5-1ubuntu1
* Merge from debian unstable, remaining changes: 
  + fixing missing pid directory in /var/run
* Added the same patch to debian/zabbix-server-{mysql,pgsql}.zabbix-server.init
  (LP: #172775)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
DESC="Zabbix agent"
13
13
PID=/var/run/zabbix-agent/$NAME.pid
14
14
 
 
15
DIR=/var/run/zabbix-server
 
16
 
 
17
if test ! -d "$DIR"; then
 
18
        mkdir "$DIR"
 
19
        chown -R zabbix:zabbix "$DIR"
 
20
fi
 
21
 
15
22
test -f $DAEMON || exit 0
16
23
 
17
24
set -e
18
25
 
19
 
if ! [ -d `dirname $PID` ]; then
20
 
        mkdir -p `dirname $PID`
21
 
        chown zabbix:zabbix `dirname $PID`
22
 
fi
23
 
 
24
26
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
25
27
 
26
28
case "$1" in
28
30
        rm -f $PID
29
31
        echo "Starting $DESC: $NAME" >&2
30
32
        start-stop-daemon --oknodo --start --pidfile $PID \
31
 
         --exec $DAEMON  < /dev/null &> /dev/null
 
33
         --exec $DAEMON >/dev/null 2>&1
32
34
        ;;
33
35
  stop)
34
36
        echo "Stopping $DESC: $NAME"
36
38
        ;;
37
39
  restart|force-reload)
38
40
        $0 stop
39
 
        sleep 2
 
41
        sleep 5
40
42
        $0 start
41
43
        ;;
42
44
  *)