Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAndris Mednis <Andris.Mednis@zabbix.com>2012-05-30 19:43:20 +0400
committerAndris Mednis <Andris.Mednis@zabbix.com>2012-05-30 19:43:20 +0400
commitdeaa44f96cba0003708656555220ba98859b8949 (patch)
tree01c3416d728b27e3e0e59d277c1d192cf2ae7715 /misc
parent1ec502dc7939c75db4dc52ab604c2c0bd184e2a8 (diff)
....I..... [ZBX-5058] init.d scripts updated for Zabbix 2.0
Diffstat (limited to 'misc')
-rw-r--r--misc/init.d/README5
-rwxr-xr-xmisc/init.d/aix/zabbix_agentd4
-rwxr-xr-xmisc/init.d/debian/zabbix-agent2
-rwxr-xr-xmisc/init.d/debian/zabbix-server2
-rwxr-xr-xmisc/init.d/fedora/core/zabbix_agentd9
-rwxr-xr-xmisc/init.d/fedora/core/zabbix_server9
-rwxr-xr-xmisc/init.d/fedora/core5/zabbix_agentd18
-rwxr-xr-xmisc/init.d/fedora/core5/zabbix_server18
-rwxr-xr-xmisc/init.d/freebsd/zabbix_agentd1
-rwxr-xr-xmisc/init.d/freebsd/zabbix_server1
-rwxr-xr-xmisc/init.d/gentoo/zabbix-agentd9
-rwxr-xr-xmisc/init.d/gentoo/zabbix-server9
-rw-r--r--misc/init.d/redhat/8.0/zabbix_agentd89
-rw-r--r--misc/init.d/redhat/8.0/zabbix_server85
-rwxr-xr-xmisc/init.d/redhat/zabbix_agentd_ctl149
-rwxr-xr-xmisc/init.d/redhat/zabbix_server_ctl149
-rw-r--r--misc/init.d/suse/9.1/zabbix_agentd18
-rw-r--r--misc/init.d/suse/9.1/zabbix_server16
-rw-r--r--misc/init.d/suse/9.2/zabbix_agentd18
-rw-r--r--misc/init.d/suse/9.2/zabbix_server18
-rw-r--r--misc/init.d/suse/9.3/zabbix_agentd18
-rw-r--r--misc/init.d/suse/9.3/zabbix_server18
-rw-r--r--misc/init.d/tru64/zabbix_agentd2
-rw-r--r--misc/init.d/tru64/zabbix_server2
-rw-r--r--misc/init.d/ubuntu/zabbix-agent.conf2
-rw-r--r--misc/init.d/ubuntu/zabbix-server.conf2
26 files changed, 79 insertions, 594 deletions
diff --git a/misc/init.d/README b/misc/init.d/README
new file mode 100644
index 00000000000..0117f2e5200
--- /dev/null
+++ b/misc/init.d/README
@@ -0,0 +1,5 @@
+Subdirectory misc/init.d contains examples of Zabbix server and agentd
+start/stop scripts.
+
+The scripts are not actively maintained and tested, they may be not
+up-to-date with the most recent versions of UNIX/Linux distributions.
diff --git a/misc/init.d/aix/zabbix_agentd b/misc/init.d/aix/zabbix_agentd
index c37489d5e26..da9aec4d0c1 100755
--- a/misc/init.d/aix/zabbix_agentd
+++ b/misc/init.d/aix/zabbix_agentd
@@ -7,10 +7,10 @@
case $1 in
start)
- /home/zabbix/zabbix_agentd -c /home/zabbix/zabbix_agentd.conf;;
+ /usr/local/sbin/zabbix_agentd -c /usr/local/etc/zabbix_agentd.conf;;
stop)
- kill -TERM `cat /home/zabbix/run/zabbix_agentd.pid` ;;
+ kill -TERM `cat /tmp/zabbix_agentd.pid` ;;
restart)
$0 stop
diff --git a/misc/init.d/debian/zabbix-agent b/misc/init.d/debian/zabbix-agent
index 3d4b1f17da6..b5ba66d212b 100755
--- a/misc/init.d/debian/zabbix-agent
+++ b/misc/init.d/debian/zabbix-agent
@@ -2,7 +2,7 @@
#
# Zabbix agent start/stop script.
#
-# Copyright (C) 2000-2011 Zabbix SIA
+# Copyright (C) 2000-2012 Zabbix SIA
NAME=zabbix_agentd
DAEMON=/usr/local/sbin/${NAME}
diff --git a/misc/init.d/debian/zabbix-server b/misc/init.d/debian/zabbix-server
index 17ac287cd87..d16191662ac 100755
--- a/misc/init.d/debian/zabbix-server
+++ b/misc/init.d/debian/zabbix-server
@@ -2,7 +2,7 @@
#
# Zabbix daemon start/stop script.
#
-# Copyright (C) 2000-2011 Zabbix SIA
+# Copyright (C) 2000-2012 Zabbix SIA
NAME=zabbix_server
DAEMON=/usr/local/sbin/${NAME}
diff --git a/misc/init.d/fedora/core/zabbix_agentd b/misc/init.d/fedora/core/zabbix_agentd
index b395073ab05..5b648982d95 100755
--- a/misc/init.d/fedora/core/zabbix_agentd
+++ b/misc/init.d/fedora/core/zabbix_agentd
@@ -9,6 +9,9 @@
# @author: Alexander Hagenah <hagenah@topconcepts.com>
# @created: 18.04.2006
#
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
+#
# Source function library.
. /etc/init.d/functions
@@ -16,16 +19,16 @@
# Edit these to match your system settings
# Zabbix-Directory
- BASEDIR=/opt/zabbix
+ BASEDIR=/usr/local
# Binary File
BINARY_NAME=zabbix_agentd
# Full Binary File Call
- FULLPATH=$BASEDIR/bin/$BINARY_NAME
+ FULLPATH=$BASEDIR/sbin/$BINARY_NAME
# PID file
- PIDFILE=/var/tmp/$BINARY_NAME.pid
+ PIDFILE=/tmp/$BINARY_NAME.pid
# Establish args
ERROR=0
diff --git a/misc/init.d/fedora/core/zabbix_server b/misc/init.d/fedora/core/zabbix_server
index c0e4d0d24b3..c10e7dcf128 100755
--- a/misc/init.d/fedora/core/zabbix_server
+++ b/misc/init.d/fedora/core/zabbix_server
@@ -9,6 +9,9 @@
# @author: Alexander Hagenah <hagenah@topconcepts.com>
# @created: 18.04.2006
#
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
+#
# Source function library.
. /etc/init.d/functions
@@ -16,16 +19,16 @@
# Edit these to match your system settings
# Zabbix-Directory
- BASEDIR=/opt/zabbix
+ BASEDIR=/usr/local
# Binary File
BINARY_NAME=zabbix_server
# Full Binary File Call
- FULLPATH=$BASEDIR/bin/$BINARY_NAME
+ FULLPATH=$BASEDIR/sbin/$BINARY_NAME
# PID file
- PIDFILE=/var/tmp/$BINARY_NAME.pid
+ PIDFILE=/tmp/$BINARY_NAME.pid
# Establish args
ERROR=0
diff --git a/misc/init.d/fedora/core5/zabbix_agentd b/misc/init.d/fedora/core5/zabbix_agentd
index 8b085bb530f..aacb27b1d2f 100755
--- a/misc/init.d/fedora/core5/zabbix_agentd
+++ b/misc/init.d/fedora/core5/zabbix_agentd
@@ -7,7 +7,10 @@
# chkconfig: - 95 5
# description: Zabbix Monitoring Agent
# processname: zabbix_agentd
-# pidfile: /var/tmp/zabbix_agentd.pid
+# pidfile: /tmp/zabbix_agentd.pid
+
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
# Source function library.
@@ -15,16 +18,7 @@
RETVAL=0
prog="Zabbix Agent"
-CONFIG_FILE="/etc/zabbix/zabbix_agentd.conf"
-ZABBIX_BIN="/usr/sbin/zabbix_agentd"
-
-test -x $ZABBIX_BIN || exit 0
-
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- exit 6
-fi
+ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"
if [ ! -x ${ZABBIX_BIN} ] ; then
echo -n "${ZABBIX_BIN} not installed! "
@@ -34,7 +28,7 @@ fi
start() {
echo -n $"Starting $prog: "
- daemon $ZABBIX_BIN -c $CONFIG_FILE
+ daemon $ZABBIX_BIN
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_agentd
echo
diff --git a/misc/init.d/fedora/core5/zabbix_server b/misc/init.d/fedora/core5/zabbix_server
index 22a1b2f3705..5058a781ad1 100755
--- a/misc/init.d/fedora/core5/zabbix_server
+++ b/misc/init.d/fedora/core5/zabbix_server
@@ -7,7 +7,10 @@
# chkconfig: - 95 5
# description: Zabbix Monitoring Server
# processname: zabbix_server
-# pidfile: /var/tmp/zabbix_server.pid
+# pidfile: /tmp/zabbix_server.pid
+
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
# Source function library.
@@ -15,16 +18,7 @@
RETVAL=0
prog="Zabbix Server"
-CONFIG_FILE="/etc/zabbix/zabbix_server.conf"
-ZABBIX_BIN="/usr/sbin/zabbix_server"
-
-test -x $ZABBIX_BIN || exit 0
-
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- exit 6
-fi
+ZABBIX_BIN="/usr/local/sbin/zabbix_server"
if [ ! -x ${ZABBIX_BIN} ] ; then
echo -n "${ZABBIX_BIN} not installed! "
@@ -34,7 +28,7 @@ fi
start() {
echo -n $"Starting $prog: "
- daemon $ZABBIX_BIN -c $CONFIG_FILE
+ daemon $ZABBIX_BIN
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_server
echo
diff --git a/misc/init.d/freebsd/zabbix_agentd b/misc/init.d/freebsd/zabbix_agentd
index c25623b706b..c092d72b797 100755
--- a/misc/init.d/freebsd/zabbix_agentd
+++ b/misc/init.d/freebsd/zabbix_agentd
@@ -6,6 +6,5 @@ name="zabbix_agentd"
load_rc_config ${name}
rcvar=`set_rcvar`
command="${prefix:-"/usr/local"}/sbin/${name}"
-required_files="/etc/zabbix/${name}.conf"
run_rc_command "$1"
diff --git a/misc/init.d/freebsd/zabbix_server b/misc/init.d/freebsd/zabbix_server
index 9325d4d739a..ee6d9ed090a 100755
--- a/misc/init.d/freebsd/zabbix_server
+++ b/misc/init.d/freebsd/zabbix_server
@@ -6,6 +6,5 @@ name="zabbix_server"
load_rc_config ${name}
rcvar=`set_rcvar`
command="${prefix:-"/usr/local"}/sbin/${name}"
-required_files="/etc/zabbix/${name}.conf"
run_rc_command "$1"
diff --git a/misc/init.d/gentoo/zabbix-agentd b/misc/init.d/gentoo/zabbix-agentd
index a05bd80b4a8..571ed157273 100755
--- a/misc/init.d/gentoo/zabbix-agentd
+++ b/misc/init.d/gentoo/zabbix-agentd
@@ -3,11 +3,14 @@
# Zabbix agent start/stop script.
#
# Written by A. Tophofen
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
+
NAME=zabbix_agentd
-PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
-DAEMON=/home/zabbix/bin/${NAME}
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
+DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix agent"
-PID=/home/zabbix/lock/$NAME.pid
+PID=/tmp/$NAME.pid
opts="${opts} reload"
diff --git a/misc/init.d/gentoo/zabbix-server b/misc/init.d/gentoo/zabbix-server
index b8a3783be84..e3dcddc2f7d 100755
--- a/misc/init.d/gentoo/zabbix-server
+++ b/misc/init.d/gentoo/zabbix-server
@@ -3,11 +3,14 @@
# Zabbix server start/stop script.
#
# Written by A. Tophofen
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
+
NAME=zabbix_server
-PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
-DAEMON=/home/zabbix/bin/${NAME}
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
+DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix server"
-PID=/home/zabbix/lock/$NAME.pid
+PID=/tmp/$NAME.pid
opts="${opts} reload"
diff --git a/misc/init.d/redhat/8.0/zabbix_agentd b/misc/init.d/redhat/8.0/zabbix_agentd
deleted file mode 100644
index 1418b52f168..00000000000
--- a/misc/init.d/redhat/8.0/zabbix_agentd
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/bash
-#
-# chkconfig: - 55 45
-# description: zabbix_agentd
-# probe: false
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-# Source networking configuration.
-. /etc/sysconfig/network
-
-# Check that networking is up. If you are running without a network, comment this out.
-[ "${NETWORKING}" = "no" ] && exit 0
-
-RETVAL=0
-progdir="/usr/local/zabbix/bin/"
-prog="zabbix_agentd"
-
-start() {
- # Start daemons.
- if [ -n "`/sbin/pidof $prog`" ]; then
- echo -n "$prog: already running"
- failure $"$prog start"
- echo
- return 1
- fi
- echo -n $"Starting $prog: "
- # we can't seem to use daemon here - emulate its functionality
- su -c $progdir$prog - $USER
- RETVAL=$?
- usleep 100000
- if [ -z "`/sbin/pidof $progdir$prog`" ]; then
- # The child processes have died after fork()ing, e.g.
- # because of a broken config file
- RETVAL=1
- fi
- [ $RETVAL -ne 0 ] && failure $"$prog startup"
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog && success $"$prog startup"
- echo
- return $RETVAL
-}
-stop() {
- RETVAL=0
- pid=
- # Stop daemons.
- echo -n $"Stopping $prog: "
- pid=`/sbin/pidof -s $prog`
- if [ -n "$pid" ]; then
- kill -TERM $pid
- else
- failure $"$prog stop"
- echo
- return 1
- fi
- RETVAL=$?
- [ $RETVAL -ne 0 ] && failure $"$prog stop"
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog && success $"$prog stop"
- echo
- return $RETVAL
-}
-restart() {
- stop
-# wait for forked daemons to die
- usleep 1000000
- start
-}
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- restart
- ;;
- condrestart)
- [ -f /var/lock/subsys/$prog ] && restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|condrestart}"
- exit 1
-esac
-
-exit $?
-
diff --git a/misc/init.d/redhat/8.0/zabbix_server b/misc/init.d/redhat/8.0/zabbix_server
deleted file mode 100644
index 6cea792ecb6..00000000000
--- a/misc/init.d/redhat/8.0/zabbix_server
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-#
-# chkconfig: - 55 45
-# description: zabbix_server
-# probe: false
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-# Source networking configuration.
-. /etc/sysconfig/network
-
-# Check that networking is up. If you are running without a network, comment this out.
-[ "${NETWORKING}" = "no" ] && exit 0
-
-RETVAL=0
-progdir="/usr/local/zabbix/bin/"
-prog="zabbix_server"
-
-start() {
- # Start daemons.
- if [ -n "`/sbin/pidof $prog`" ]; then
- echo -n "$prog: already running"
- failure $"$prog start"
- echo
- return 1
- fi
- echo -n $"Starting $prog: "
- # we can't seem to use daemon here - emulate its functionality
- su -c $progdir$prog - $USER
- RETVAL=$?
- usleep 100000
- if [ -z "`/sbin/pidof $progdir$prog`" ]; then
- RETVAL=1
- fi
- [ $RETVAL -ne 0 ] && failure $"$prog startup"
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog && success $"$prog startup"
- echo
- return $RETVAL
-}
-stop() {
- RETVAL=0
- pid=
- # Stop daemons.
- echo -n $"Stopping $prog: "
- pid=`/sbin/pidof -s $prog`
- if [ -n "$pid" ]; then
- kill -TERM $pid
- else
- failure $"$prog stop"
- echo
- return 1
- fi
- RETVAL=$?
- [ $RETVAL -ne 0 ] && failure $"$prog stop"
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog && success $"$prog stop"
- echo
- return $RETVAL
-}
-restart() {
- stop
- start
-}
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- restart
- ;;
- condrestart)
- [ -f /var/lock/subsys/$prog ] && restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|condrestart}"
- exit 1
-esac
-
-exit $?
-
diff --git a/misc/init.d/redhat/zabbix_agentd_ctl b/misc/init.d/redhat/zabbix_agentd_ctl
deleted file mode 100755
index a06dcd187f3..00000000000
--- a/misc/init.d/redhat/zabbix_agentd_ctl
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/sh
-#
-# zabbix_agentd_ctl
-#
-# control script to stop/start/restart zabbix_agentd
-# author: charlie collins
-# date: 01.21.2002
-#
-# revised 09.21.2003
-# (setup for Red Hat 7.3 with Zabbix 1.0 beta)
-# (should work for other Red Hat and Sys V style init machines as well)
-#
-# (modeled after apache style control scripts)
-# (this script can be placed in init.d and respective runlevel for startup usage)
-#
-#
-# The exit codes returned are:
-# 0 - operation completed successfully
-# 1 -
-# 2 - usage error
-# 3 - zabbix_agentd could not be started
-# 4 - zabbix_agentd could not be stopped
-# 5 - zabbix_agentd could not be started during a restart
-# 6 - zabbix_agentd could not be restarted during a restart
-#
-#
-#
-
-# **************
-# config options
-# **************
-#
-# (set config options to match your system settings)
-
-# base zabbix dir
-BASEDIR=/opt/zabbix
-# pid file (as of 1.0 beta 10)
-PIDFILE=/var/tmp/zabbix_agentd.pid
-# binary file
-ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd
-
-
-# **************
-# logic section (below here) does NOT normally need any modification
-# **************
-
-# establish args
-ERROR=0
-ARGV="$@"
-if [ "x$ARGV" = "x" ] ; then
- ARGS="help"
-fi
-
-
-# perform action based on args
-for ARG in $@ $ARGS
-do
- # check if PIDFILE exists and ensure is not zero size and react accordingly
- if [ -f $PIDFILE ] && [ -s $PIDFILE ] ; then
- PID=`cat $PIDFILE`
- if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
- STATUS="zabbix_agentd (pid $PID) running"
- RUNNING=1
- else
- STATUS="zabbix_agentd (pid $PID?) not running"
- RUNNING=0
- fi
- else
- STATUS="zabbix_agentd (no pid file) not running"
- RUNNING=0
- fi
-
- # parse arg and react accordingly
- case $ARG in
-
- start)
- if [ $RUNNING -eq 1 ]; then
- echo "$0 $ARG: zabbix_agentd (pid $PID) already running"
- continue
- fi
- if $ZABBIX_AGENTD ; then
- echo "$0 $ARG: zabbix_agentd started"
- else
- echo "$0 $ARG: zabbix_agentd could not be started"
- ERROR=3
- fi
- ;;
-
- stop)
- if [ $RUNNING -eq 0 ]; then
- echo "stop called - in running eq 0"
- echo "$0 $ARG: $STATUS"
- continue
- fi
- if kill $PID ; then
- echo "$0 $ARG: zabbix_agentd process(es) stopped"
- else
- echo "$0 $ARG: zabbix_agentd process(es) could not be stopped"
- ERROR=4
- fi
- ;;
-
- restart)
- if [ $RUNNING -eq 0 ]; then
- echo "$0 $ARG: zabbix_agentd not running, trying to start"
- if $ZABBIX_AGENTD ; then
- echo "$0 $ARG: zabbix_agentd started"
- else
- echo "$0 $ARG: zabbix_agentd could not be started"
- ERROR=5
- fi
- else
- if kill $PID ; then
- if $ZABBIX_AGENTD ; then
- echo "$0 $ARG: zabbix_agentd restarted"
- else
- echo "$0 $ARG: zabbix_agentd could not be started"
- ERROR=3
- fi
- else
- echo "$0 $ARG: zabbix_agentd could not be restarted"
- ERROR=6
- fi
- fi
- ;;
-
- *)
-
- echo "usage: $0 (start|stop|restart|help)"
- cat <<EOF
-
-start - start zabbix_agentd
-stop - stop zabbix_agentd
-restart - restart zabbix_agentd if running by sending a SIGHUP or start if not running
-help - this screen
-
-EOF
-
- ERROR=2
- ;;
-
- esac
-
-done
-
-exit $ERROR
-
-
-
diff --git a/misc/init.d/redhat/zabbix_server_ctl b/misc/init.d/redhat/zabbix_server_ctl
deleted file mode 100755
index 3bbecb20a13..00000000000
--- a/misc/init.d/redhat/zabbix_server_ctl
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/sh
-#
-# zabbix_server_ctl
-#
-# control script to stop/start/restart zabbix_server
-# author: charlie collins
-# date: 01.21.2002
-#
-# revised 09.21.2003
-# (setup for Red Hat 7.3 with Zabbix 1.0 beta)
-# (should work for other Red Hat and Sys V style init machines as well)
-#
-# (modeled after apache style control scripts)
-# (this script can be placed in init.d and respective runlevel for startup usage)
-#
-#
-# The exit codes returned are:
-# 0 - operation completed successfully
-# 1 -
-# 2 - usage error
-# 3 - zabbix_server could not be started
-# 4 - zabbix_server could not be stopped
-# 5 - zabbix_server could not be started during a restart
-# 6 - zabbix_server could not be restarted during a restart
-#
-#
-#
-
-# **************
-# config options
-# **************
-#
-# (set config options to match your system settings)
-
-# base zabbix dir
-BASEDIR=/opt/zabbix
-# PID file
-PIDFILE=/var/tmp/zabbix_server.pid
-# binary file
-ZABBIX_SUCKERD=$BASEDIR/sbin/zabbix_server
-
-
-# **************
-# logic section (below here) does NOT normally need any modification
-# **************
-
-# establish args
-ERROR=0
-ARGV="$@"
-if [ "x$ARGV" = "x" ] ; then
- ARGS="help"
-fi
-
-
-# perform action based on args
-for ARG in $@ $ARGS
-do
- # check if PIDFILE exists and ensure is not zero size and react accordingly
- if [ -f $PIDFILE ] && [ -s $PIDFILE ] ; then
- PID=`cat $PIDFILE`
- if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
- STATUS="zabbix_server (pid $PID) running"
- RUNNING=1
- else
- STATUS="zabbix_server (pid $PID?) not running"
- RUNNING=0
- fi
- else
- STATUS="zabbix_server (no pid file) not running"
- RUNNING=0
- fi
-
- # parse arg and react accordingly
- case $ARG in
-
- start)
- if [ $RUNNING -eq 1 ]; then
- echo "$0 $ARG: zabbix_server (pid $PID) already running"
- continue
- fi
- if $ZABBIX_SUCKERD ; then
- echo "$0 $ARG: zabbix_server started"
- else
- echo "$0 $ARG: zabbix_server could not be started"
- ERROR=3
- fi
- ;;
-
- stop)
- if [ $RUNNING -eq 0 ]; then
- echo "stop called - in running eq 0"
- echo "$0 $ARG: $STATUS"
- continue
- fi
- if kill $PID ; then
- echo "$0 $ARG: zabbix_server process(es) stopped"
- else
- echo "$0 $ARG: zabbix_server process(es) could not be stopped"
- ERROR=4
- fi
- ;;
-
- restart)
- if [ $RUNNING -eq 0 ]; then
- echo "$0 $ARG: zabbix_server not running, trying to start"
- if $ZABBIX_SUCKERD ; then
- echo "$0 $ARG: zabbix_server started"
- else
- echo "$0 $ARG: zabbix_server could not be started"
- ERROR=5
- fi
- else
- if kill $PID ; then
- if $ZABBIX_SUCKERD ; then
- echo "$0 $ARG: zabbix_server restarted"
- else
- echo "$0 $ARG: zabbix_server could not be started"
- ERROR=3
- fi
- else
- echo "$0 $ARG: zabbix_server could not be restarted"
- ERROR=6
- fi
- fi
- ;;
-
- *)
-
- echo "usage: $0 (start|stop|restart|help)"
- cat <<EOF
-
-start - start zabbix_server
-stop - stop zabbix_server
-restart - restart zabbix_server if running by sending a SIGHUP or start if not running
-help - this screen
-
-EOF
-
- ERROR=2
- ;;
-
- esac
-
-done
-
-exit $ERROR
-
-
-
diff --git a/misc/init.d/suse/9.1/zabbix_agentd b/misc/init.d/suse/9.1/zabbix_agentd
index 44fe8884889..2542ba57bf4 100644
--- a/misc/init.d/suse/9.1/zabbix_agentd
+++ b/misc/init.d/suse/9.1/zabbix_agentd
@@ -1,5 +1,7 @@
#! /bin/sh
# Copyright (c) 07/2004 A.Tophofen, Germany
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
#
# init.d/zabbix_agentd
#
@@ -15,18 +17,9 @@
. /etc/rc.status
rc_reset
NAME="Zabbix_Agentd"
-CONFIG_FILE="/etc/zabbix/zabbix_agentd.conf"
-
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- rc_status -s
- exit 6
-fi
-
-ZABBIX_BIN="/home/zabbix/sbin/zabbix_agentd"
-ZABBIX_PID="/home/zabbix/lock/zabbix_agentd.pid"
+ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"
+ZABBIX_PID="/tmp/zabbix_agentd.pid"
if [ ! -x ${ZABBIX_BIN} ] ; then
echo -n "${ZABBIX_BIN} not installed! "
@@ -35,8 +28,7 @@ if [ ! -x ${ZABBIX_BIN} ] ; then
exit 5
fi
-
-export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/home/zabbix/bin"
+export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin"
case "$1" in
start)
diff --git a/misc/init.d/suse/9.1/zabbix_server b/misc/init.d/suse/9.1/zabbix_server
index fa44ce2ad3b..94f28016745 100644
--- a/misc/init.d/suse/9.1/zabbix_server
+++ b/misc/init.d/suse/9.1/zabbix_server
@@ -1,5 +1,7 @@
#! /bin/sh
# Copyright (c) 07/2004 A.Tophofen, Germany
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
#
# init.d/zabbix_agentd
#
@@ -15,17 +17,9 @@
. /etc/rc.status
rc_reset
NAME="Zabbix_Server"
-CONFIG_FILE="/etc/zabbix/zabbix_server.conf"
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- rc_status -s
- exit 6
-fi
-
-ZABBIX_BIN="/home/zabbix/sbin/zabbix_server"
-ZABBIX_PID="/home/zabbix/lock/zabbix_server.pid"
+ZABBIX_BIN="/usr/local/sbin/zabbix_server"
+ZABBIX_PID="/tmp/zabbix_server.pid"
if [ ! -x ${ZABBIX_BIN} ] ; then
@@ -36,7 +30,7 @@ if [ ! -x ${ZABBIX_BIN} ] ; then
fi
-export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/home/zabbix/bin"
+export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin"
case "$1" in
start)
diff --git a/misc/init.d/suse/9.2/zabbix_agentd b/misc/init.d/suse/9.2/zabbix_agentd
index 154fa12d389..4da81752ee3 100644
--- a/misc/init.d/suse/9.2/zabbix_agentd
+++ b/misc/init.d/suse/9.2/zabbix_agentd
@@ -2,6 +2,8 @@
# Copyright (c) 07/2004 A.Tophofen, Germany
# Modified for Zabbix 1.1alpha7 and SuSE Linux 9.2
# April 2005, A. Kiepe, Switzerland
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
#
# init.d/zabbix_agentd
#
@@ -17,18 +19,9 @@
. /etc/rc.status
rc_reset
NAME="zabbix_agentd"
-CONFIG_FILE="/etc/zabbix/zabbix_agentd.conf"
-
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- rc_status -s
- exit 6
-fi
-
-ZABBIX_BIN="/opt/zabbix/sbin/zabbix_agentd"
-ZABBIX_PID="/var/tmp/zabbix_agentd.pid"
+ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"
+ZABBIX_PID="/tmp/zabbix_agentd.pid"
if [ ! -x ${ZABBIX_BIN} ] ; then
echo -n "${ZABBIX_BIN} not installed! "
@@ -37,8 +30,7 @@ if [ ! -x ${ZABBIX_BIN} ] ; then
exit 5
fi
-
-export PATH=$PATH:/opt/zabbix/bin
+export PATH=$PATH:/usr/local/sbin
case "$1" in
start)
diff --git a/misc/init.d/suse/9.2/zabbix_server b/misc/init.d/suse/9.2/zabbix_server
index 16f4d9356e0..daf5766c7ae 100644
--- a/misc/init.d/suse/9.2/zabbix_server
+++ b/misc/init.d/suse/9.2/zabbix_server
@@ -2,6 +2,8 @@
# Copyright (c) 07/2004 A.Tophofen, Germany
# Modified for Zabbix 1.1alpha7 and SuSE Linux 9.2
# April 2005, A. Kiepe, Switzerland
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
#
# init.d/zabbix_server
#
@@ -18,18 +20,9 @@
. /etc/rc.status
rc_reset
NAME="zabbix_server"
-CONFIG_FILE="/etc/zabbix/zabbix_server.conf"
-
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- rc_status -s
- exit 6
-fi
-
-ZABBIX_BIN="/opt/zabbix/sbin/zabbix_server"
-ZABBIX_PID="/var/tmp/zabbix_server.pid"
+ZABBIX_BIN="/usr/local/sbin/zabbix_server"
+ZABBIX_PID="/tmp/zabbix_server.pid"
if [ ! -x ${ZABBIX_BIN} ] ; then
echo -n "${ZABBIX_BIN} not installed! "
@@ -38,8 +31,7 @@ if [ ! -x ${ZABBIX_BIN} ] ; then
exit 5
fi
-
-export PATH=$PATH:/opt/zabbix/bin
+export PATH=$PATH:/usr/local/sbin
case "$1" in
start)
diff --git a/misc/init.d/suse/9.3/zabbix_agentd b/misc/init.d/suse/9.3/zabbix_agentd
index 154fa12d389..4da81752ee3 100644
--- a/misc/init.d/suse/9.3/zabbix_agentd
+++ b/misc/init.d/suse/9.3/zabbix_agentd
@@ -2,6 +2,8 @@
# Copyright (c) 07/2004 A.Tophofen, Germany
# Modified for Zabbix 1.1alpha7 and SuSE Linux 9.2
# April 2005, A. Kiepe, Switzerland
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
#
# init.d/zabbix_agentd
#
@@ -17,18 +19,9 @@
. /etc/rc.status
rc_reset
NAME="zabbix_agentd"
-CONFIG_FILE="/etc/zabbix/zabbix_agentd.conf"
-
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- rc_status -s
- exit 6
-fi
-
-ZABBIX_BIN="/opt/zabbix/sbin/zabbix_agentd"
-ZABBIX_PID="/var/tmp/zabbix_agentd.pid"
+ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"
+ZABBIX_PID="/tmp/zabbix_agentd.pid"
if [ ! -x ${ZABBIX_BIN} ] ; then
echo -n "${ZABBIX_BIN} not installed! "
@@ -37,8 +30,7 @@ if [ ! -x ${ZABBIX_BIN} ] ; then
exit 5
fi
-
-export PATH=$PATH:/opt/zabbix/bin
+export PATH=$PATH:/usr/local/sbin
case "$1" in
start)
diff --git a/misc/init.d/suse/9.3/zabbix_server b/misc/init.d/suse/9.3/zabbix_server
index 16f4d9356e0..daf5766c7ae 100644
--- a/misc/init.d/suse/9.3/zabbix_server
+++ b/misc/init.d/suse/9.3/zabbix_server
@@ -2,6 +2,8 @@
# Copyright (c) 07/2004 A.Tophofen, Germany
# Modified for Zabbix 1.1alpha7 and SuSE Linux 9.2
# April 2005, A. Kiepe, Switzerland
+# Modified for Zabbix 2.0.0
+# May 2012, Zabbix SIA
#
# init.d/zabbix_server
#
@@ -18,18 +20,9 @@
. /etc/rc.status
rc_reset
NAME="zabbix_server"
-CONFIG_FILE="/etc/zabbix/zabbix_server.conf"
-
-if [ ! -f ${CONFIG_FILE} ]; then
- echo -n "${NAME}configuration file ${CONFIG_FILE} does not exist. "
- # Tell the user this has skipped
- rc_status -s
- exit 6
-fi
-
-ZABBIX_BIN="/opt/zabbix/sbin/zabbix_server"
-ZABBIX_PID="/var/tmp/zabbix_server.pid"
+ZABBIX_BIN="/usr/local/sbin/zabbix_server"
+ZABBIX_PID="/tmp/zabbix_server.pid"
if [ ! -x ${ZABBIX_BIN} ] ; then
echo -n "${ZABBIX_BIN} not installed! "
@@ -38,8 +31,7 @@ if [ ! -x ${ZABBIX_BIN} ] ; then
exit 5
fi
-
-export PATH=$PATH:/opt/zabbix/bin
+export PATH=$PATH:/usr/local/sbin
case "$1" in
start)
diff --git a/misc/init.d/tru64/zabbix_agentd b/misc/init.d/tru64/zabbix_agentd
index eeb13d40380..451d760b0a9 100644
--- a/misc/init.d/tru64/zabbix_agentd
+++ b/misc/init.d/tru64/zabbix_agentd
@@ -1,7 +1,7 @@
#!/bin/sh
# Zabbix
-# Copyright (C) 2000-2011 Zabbix SIA
+# Copyright (C) 2000-2012 Zabbix SIA
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/misc/init.d/tru64/zabbix_server b/misc/init.d/tru64/zabbix_server
index a59cbb030f7..47dc82b1571 100644
--- a/misc/init.d/tru64/zabbix_server
+++ b/misc/init.d/tru64/zabbix_server
@@ -1,7 +1,7 @@
#!/bin/sh
# Zabbix
-# Copyright (C) 2000-2011 Zabbix SIA
+# Copyright (C) 2000-2012 Zabbix SIA
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/misc/init.d/ubuntu/zabbix-agent.conf b/misc/init.d/ubuntu/zabbix-agent.conf
index 45420c5f4c2..ca0541daeb3 100644
--- a/misc/init.d/ubuntu/zabbix-agent.conf
+++ b/misc/init.d/ubuntu/zabbix-agent.conf
@@ -5,4 +5,4 @@ start on runlevel [2345]
stop on runlevel [016]
respawn
expect daemon
-exec /usr/sbin/zabbix_agentd
+exec /usr/local/sbin/zabbix_agentd
diff --git a/misc/init.d/ubuntu/zabbix-server.conf b/misc/init.d/ubuntu/zabbix-server.conf
index 8c4b6e50106..96dd8031c74 100644
--- a/misc/init.d/ubuntu/zabbix-server.conf
+++ b/misc/init.d/ubuntu/zabbix-server.conf
@@ -6,4 +6,4 @@ start on (runlevel [2345]
stop on runlevel [016]
respawn
expect daemon
-exec /usr/sbin/zabbix_server
+exec /usr/local/sbin/zabbix_server