diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-28 13:32:10 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-28 13:32:10 +0000 |
| commit | 3442ec61fa38eea4e68a3edea4ea3225ff78c8a0 (patch) | |
| tree | 3ebf399a0be7c8ca22745e08ae2c0b4e300a86e5 /misc | |
| parent | fb8127285b3156270151079a29825130cf85d524 (diff) | |
| download | zabbix-3442ec61fa38eea4e68a3edea4ea3225ff78c8a0.tar.gz zabbix-3442ec61fa38eea4e68a3edea4ea3225ff78c8a0.tar.xz zabbix-3442ec61fa38eea4e68a3edea4ea3225ff78c8a0.zip | |
- modifed startup scripts (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@4187 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'misc')
| -rwxr-xr-x | misc/init.d/debian/zabbix-agent | 8 | ||||
| -rwxr-xr-x | misc/init.d/debian/zabbix-server (renamed from misc/init.d/debian/zabbix-suckerd) | 13 | ||||
| -rwxr-xr-x | misc/init.d/debian/zabbix-trapperd | 51 | ||||
| -rwxr-xr-x | misc/init.d/fedora/core5/zabbix_agentd | 79 | ||||
| -rw-r--r-- | misc/init.d/gentoo/zabbix-agentd | 6 | ||||
| -rw-r--r-- | misc/init.d/gentoo/zabbix-server (renamed from misc/init.d/gentoo/zabbix-suckerd) | 8 | ||||
| -rw-r--r-- | misc/init.d/gentoo/zabbix-trapperd | 34 | ||||
| -rw-r--r-- | misc/init.d/redhat/8.0/zabbix_server (renamed from misc/init.d/redhat/8.0/zabbix_suckerd) | 4 | ||||
| -rw-r--r-- | misc/init.d/redhat/8.0/zabbix_trapperd | 87 | ||||
| -rwxr-xr-x | misc/init.d/redhat/zabbix_server_ctl (renamed from misc/init.d/redhat/zabbix_suckerd_ctl) | 50 | ||||
| -rw-r--r-- | misc/init.d/suse/9.1/zabbix_server (renamed from misc/init.d/suse/9.1/zabbix_suckerd) | 10 | ||||
| -rw-r--r-- | misc/init.d/tru64/zabbix_server | 56 |
12 files changed, 185 insertions, 221 deletions
diff --git a/misc/init.d/debian/zabbix-agent b/misc/init.d/debian/zabbix-agent index 78ac583e..234e5534 100755 --- a/misc/init.d/debian/zabbix-agent +++ b/misc/init.d/debian/zabbix-agent @@ -4,10 +4,10 @@ # # Written by Alexei Vladishev <alexei.vladishev@zabbix.com>. -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin -DAEMON=/home/zabbix/bin/zabbix_agentd NAME=zabbix_agentd -DESC="Zabbix agent" +PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin +DAEMON=/home/zabbix/bin/${NAME} +DESC="Zabbix agent daemon" PID=/var/tmp/$NAME.pid test -f $DAEMON || exit 0 @@ -31,7 +31,7 @@ case "$1" in # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # -# echo -n "Restarting $DESC: zabbix_suckerd" +# echo -n "Restarting $DESC: zabbix_agent" $0 stop $0 start # start-stop-daemon --stop --quiet --pidfile \ diff --git a/misc/init.d/debian/zabbix-suckerd b/misc/init.d/debian/zabbix-server index 6f2498a5..367dc3bc 100755 --- a/misc/init.d/debian/zabbix-suckerd +++ b/misc/init.d/debian/zabbix-server @@ -4,10 +4,11 @@ # # Written by Alexei Vladishev <alexei.vladishev@zabbix.com>. +NAME=zabbix_server PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin -DAEMON=/home/zabbix/bin/zabbix_suckerd -NAME=zabbix_suckerd -DESC="Zabbix sucker daemon" +DAEMON=/home/zabbix/bin/${NAME} +DESC="Zabbix server daemon" +PID=/var/tmp/$NAME.pid test -f $DAEMON || exit 0 @@ -16,12 +17,12 @@ set -e case "$1" in start) echo "Starting $DESC: $NAME" - start-stop-daemon --oknodo --start --pidfile /tmp/$NAME.pid \ + start-stop-daemon --oknodo --start --pidfile $PID \ --exec $DAEMON ;; stop) echo "Stopping $DESC: $NAME" - start-stop-daemon --oknodo --stop --pidfile /tmp/$NAME.pid \ + start-stop-daemon --oknodo --stop --pidfile $PID \ --exec $DAEMON ;; restart|force-reload) @@ -30,7 +31,7 @@ case "$1" in # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # -# echo -n "Restarting $DESC: zabbix_suckerd" +# echo -n "Restarting $DESC: zabbix_server" $0 stop $0 start # start-stop-daemon --stop --quiet --pidfile \ diff --git a/misc/init.d/debian/zabbix-trapperd b/misc/init.d/debian/zabbix-trapperd deleted file mode 100755 index c9330eb5..00000000 --- a/misc/init.d/debian/zabbix-trapperd +++ /dev/null @@ -1,51 +0,0 @@ -#! /bin/sh -# -# Zabbix daemon start/stop script. -# -# Written by Alexei Vladishev <alexei.vladishev@zabbix.com>. - -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin -DAEMON=/home/zabbix/bin/zabbix_trapperd -NAME=zabbix_trapperd -DESC="Zabbix trapper daemon" - -test -f $DAEMON || exit 0 - -set -e - -case "$1" in - start) - echo "Starting $DESC: $NAME" - start-stop-daemon --oknodo --start --pidfile /tmp/$NAME.pid \ - --exec $DAEMON - ;; - stop) - echo "Stopping $DESC: $NAME" - start-stop-daemon --oknodo --stop --pidfile /tmp/$NAME.pid \ - --exec $DAEMON - ;; - restart|force-reload) - # - # If the "reload" option is implemented, move the "force-reload" - # option to the "reload" entry above. If not, "force-reload" is - # just the same as "restart". - # -# echo -n "Restarting $DESC: zabbix_suckerd" - $0 stop - $0 start -# start-stop-daemon --stop --quiet --pidfile \ -# /tmp/$NAME.pid --user zabbix --exec $DAEMON -# sleep 1 -# start-stop-daemon --start --quiet --pidfile \ -# /tmp/$NAME.pid --user zabbix --exec $DAEMON -# echo "$NAME." - ;; - *) - N=/etc/init.d/$NAME - # echo "Usage: $N {start|stop|restart|force-reload}" >&2 - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/misc/init.d/fedora/core5/zabbix_agentd b/misc/init.d/fedora/core5/zabbix_agentd new file mode 100755 index 00000000..84dc2562 --- /dev/null +++ b/misc/init.d/fedora/core5/zabbix_agentd @@ -0,0 +1,79 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/dovecot +# +# Starts the zabbix_agentd daemon +# +# chkconfig: - 95 5 +# description: Zabbix Monitoring Agent +# processname: zabbix_agentd +# pidfile: /var/tmp/zabbix_agentd.pid + +# Source function library. + +. /etc/init.d/functions + +RETVAL=0 +prog="Zabbix Agent" +CONFIG_FILE="/etc/zabbix/zabbix_agentd.conf" +ZABBIX_BIN="/usr/bin/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 + +if [ ! -x ${ZABBIX_BIN} ] ; then + echo -n "${ZABBIX_BIN} not installed! " + # Tell the user this has skipped + exit 5 +fi + +start() { + echo -n $"Starting $prog: " + daemon $ZABBIX_BIN -c $CONFIG_FILE + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_agentd + echo +} + +stop() { + echo -n $"Stopping $prog: " + killproc $ZABBIX_BIN + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix_agentd + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + reload|restart) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/zabbix_agentd ]; then + stop + start + fi + ;; + status) + status $ZABBIX_BIN + RETVAL=$? + ;; + *) + echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}" + exit 1 +esac + +exit $RETVAL + diff --git a/misc/init.d/gentoo/zabbix-agentd b/misc/init.d/gentoo/zabbix-agentd index 1a163d87..f2e4f9dd 100644 --- a/misc/init.d/gentoo/zabbix-agentd +++ b/misc/init.d/gentoo/zabbix-agentd @@ -3,10 +3,10 @@ # Zabbix agent start/stop script. # # Written by A.Tophofen -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin -DAEMON=/home/zabbix/bin/zabbix_agentd NAME=zabbix_agentd -DESC="Zabbix 1.0" +PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin +DAEMON=/home/zabbix/bin/${NAME} +DESC="Zabbix 1.4" PID=/home/zabbix/lock/$NAME.pid diff --git a/misc/init.d/gentoo/zabbix-suckerd b/misc/init.d/gentoo/zabbix-server index da6b79c7..61ffc873 100644 --- a/misc/init.d/gentoo/zabbix-suckerd +++ b/misc/init.d/gentoo/zabbix-server @@ -1,12 +1,12 @@ #!/sbin/runscript # -# Zabbix suckerdd start/stop script. +# Zabbix server start/stop script. # # Written by A.Tophofen +NAME=zabbix_server PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin -DAEMON=/home/zabbix/bin/zabbix_suckerd -NAME=zabbix_suckerd -DESC="Zabbix 1.0" +DAEMON=/home/zabbix/bin/${NAME} +DESC="Zabbix 1.4" PID=/home/zabbix/lock/$NAME.pid diff --git a/misc/init.d/gentoo/zabbix-trapperd b/misc/init.d/gentoo/zabbix-trapperd deleted file mode 100644 index abb3a9d2..00000000 --- a/misc/init.d/gentoo/zabbix-trapperd +++ /dev/null @@ -1,34 +0,0 @@ -#!/sbin/runscript -# -# Zabbix trapperd start/stop script. -# -# Written by A.Tophofen -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin -DAEMON=/home/zabbix/bin/zabbix_trapperd -NAME=zabbix_trapperd -DESC="Zabbix 1.0" -PID=/home/zabbix/lock/$NAME.pid - - - -opts="${opts} reload" - - -depend() { - need net -} - -start() { - ebegin "Starting $DESC: $NAME" - start-stop-daemon --start --pidfile $PID \ - --exec $DAEMON - eend -} -stop() { - ebegin "Stopping $DESC: $NAME" - start-stop-daemon --stop --pidfile $PID \ - --exec $DAEMON - eend -} - - diff --git a/misc/init.d/redhat/8.0/zabbix_suckerd b/misc/init.d/redhat/8.0/zabbix_server index 0263e3bd..6cea792e 100644 --- a/misc/init.d/redhat/8.0/zabbix_suckerd +++ b/misc/init.d/redhat/8.0/zabbix_server @@ -1,7 +1,7 @@ #!/bin/bash # # chkconfig: - 55 45 -# description: zabbix_suckerd +# description: zabbix_server # probe: false # Source function library. @@ -15,7 +15,7 @@ RETVAL=0 progdir="/usr/local/zabbix/bin/" -prog="zabbix_suckerd" +prog="zabbix_server" start() { # Start daemons. diff --git a/misc/init.d/redhat/8.0/zabbix_trapperd b/misc/init.d/redhat/8.0/zabbix_trapperd deleted file mode 100644 index 546f96a6..00000000 --- a/misc/init.d/redhat/8.0/zabbix_trapperd +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash -# -# chkconfig: - 55 45 -# description: zabbix_trapperd -# 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_trapperd" - -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 - start -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - condrestart) - [ -f /var/lock/subsys/zabbix_trapperd ] && restart - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart}" - exit 1 -esac - -exit $? - diff --git a/misc/init.d/redhat/zabbix_suckerd_ctl b/misc/init.d/redhat/zabbix_server_ctl index 7580690b..52a2a685 100755 --- a/misc/init.d/redhat/zabbix_suckerd_ctl +++ b/misc/init.d/redhat/zabbix_server_ctl @@ -1,8 +1,8 @@ #!/bin/sh # -# zabbix_suckerd_ctl +# zabbix_server_ctl # -# control script to stop/start/restart zabbix_suckerd +# control script to stop/start/restart zabbix_server # author: charlie collins # date: 01.21.2002 # @@ -18,10 +18,10 @@ # 0 - operation completed successfully # 1 - # 2 - usage error -# 3 - zabbix_suckerd could not be started -# 4 - zabbix_suckerd could not be stopped -# 5 - zabbix_suckerd could not be started during a restart -# 6 - zabbix_suckerd could not be restarted during a restart +# 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 # # # @@ -35,9 +35,9 @@ # base zabbix dir BASEDIR=/opt/zabbix # PID file -PIDFILE=/var/tmp/zabbix_suckerd.pid +PIDFILE=/var/tmp/zabbix_server.pid # binary file -ZABBIX_SUCKERD=$BASEDIR/bin/zabbix_suckerd +ZABBIX_SUCKERD=$BASEDIR/bin/zabbix_server # ************** @@ -59,14 +59,14 @@ do if [ -f $PIDFILE ] && [ -s $PIDFILE ] ; then PID=`cat $PIDFILE` if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then - STATUS="zabbix_suckerd (pid $PID) running" + STATUS="zabbix_server (pid $PID) running" RUNNING=1 else - STATUS="zabbix_suckerd (pid $PID?) not running" + STATUS="zabbix_server (pid $PID?) not running" RUNNING=0 fi else - STATUS="zabbix_suckerd (no pid file) not running" + STATUS="zabbix_server (no pid file) not running" RUNNING=0 fi @@ -75,13 +75,13 @@ do start) if [ $RUNNING -eq 1 ]; then - echo "$0 $ARG: zabbix_suckerd (pid $PID) already running" + echo "$0 $ARG: zabbix_server (pid $PID) already running" continue fi if $ZABBIX_SUCKERD ; then - echo "$0 $ARG: zabbix_suckerd started" + echo "$0 $ARG: zabbix_server started" else - echo "$0 $ARG: zabbix_suckerd could not be started" + echo "$0 $ARG: zabbix_server could not be started" ERROR=3 fi ;; @@ -93,32 +93,32 @@ do continue fi if kill $PID ; then - echo "$0 $ARG: zabbix_suckerd process(es) stopped" + echo "$0 $ARG: zabbix_server process(es) stopped" else - echo "$0 $ARG: zabbix_suckerd process(es) could not be stopped" + echo "$0 $ARG: zabbix_server process(es) could not be stopped" ERROR=4 fi ;; restart) if [ $RUNNING -eq 0 ]; then - echo "$0 $ARG: zabbix_suckerd not running, trying to start" + echo "$0 $ARG: zabbix_server not running, trying to start" if $ZABBIX_SUCKERD ; then - echo "$0 $ARG: zabbix_suckerd started" + echo "$0 $ARG: zabbix_server started" else - echo "$0 $ARG: zabbix_suckerd could not be started" + 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_suckerd restarted" + echo "$0 $ARG: zabbix_server restarted" else - echo "$0 $ARG: zabbix_suckerd could not be started" + echo "$0 $ARG: zabbix_server could not be started" ERROR=3 fi else - echo "$0 $ARG: zabbix_suckerd could not be restarted" + echo "$0 $ARG: zabbix_server could not be restarted" ERROR=6 fi fi @@ -129,9 +129,9 @@ do echo "usage: $0 (start|stop|restart|help)" cat <<EOF -start - start zabbix_suckerd -stop - stop zabbix_suckerd -restart - restart zabbix_suckerd if running by sending a SIGHUP or start if not running +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 diff --git a/misc/init.d/suse/9.1/zabbix_suckerd b/misc/init.d/suse/9.1/zabbix_server index d51b9221..825bd6ee 100644 --- a/misc/init.d/suse/9.1/zabbix_suckerd +++ b/misc/init.d/suse/9.1/zabbix_server @@ -4,7 +4,7 @@ # init.d/zabbix_agentd # ### BEGIN INIT INFO -# Provides: zabbix_suckerd +# Provides: zabbix_server # Required-Start: $network $remote_fs $syslog # Required-Stop: # Default-Start: 3 @@ -14,8 +14,8 @@ . /etc/rc.status rc_reset -NAME="Zabbix_Suckerd" -CONFIG_FILE="/etc/zabbix/zabbix_suckerd.conf" +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. " @@ -24,8 +24,8 @@ if [ ! -f ${CONFIG_FILE} ]; then exit 6 fi -ZABBIX_BIN="/home/zabbix/bin/zabbix_suckerd" -ZABBIX_PID="/home/zabbix/lock/zabbix_suckerd.pid" +ZABBIX_BIN="/home/zabbix/bin/zabbix_server" +ZABBIX_PID="/home/zabbix/lock/zabbix_server.pid" if [ ! -x ${ZABBIX_BIN} ] ; then diff --git a/misc/init.d/tru64/zabbix_server b/misc/init.d/tru64/zabbix_server new file mode 100644 index 00000000..bf5b561b --- /dev/null +++ b/misc/init.d/tru64/zabbix_server @@ -0,0 +1,56 @@ +#!/bin/sh + +# ZABBIX +# Copyright (C) 2000-2005 SIA Zabbix +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Start/Stop the secure shell daemon. +# Place a startup script in /sbin/init.d, and link to it from /sbin/rc[023].d + +SERVICE="ZABBIX server" +DAEMON=/usr/local/bin/zabbix_server +PIDFILE=/tmp/zabbix_server.pid + +case $1 in + 'start') + if [ -x ${DAEMON} ] + then + $DAEMON + # Error checking here would be good... + echo "${SERVICE} started." + else + echo "Can't find file ${DAEMON}." + echo "${SERVICE} NOT started." + fi + ;; + 'stop') + if [ -s ${PIDFILE} ] + then + if kill `cat ${PIDFILE}` >/dev/null 2>&1 + then + echo "${SERVICE} terminated." + rm -f ${PIDFILE} + fi + fi + ;; + 'restart') + $0 stop + $0 start + ;; + *) + echo "Usage: $0 start|stop|restart" + ;; +esac |
