summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-08-02 10:18:03 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-08-02 10:18:03 +0000
commit6d65c1403d0ee5c56ae5f1a2c58a2c0defa4c665 (patch)
treeff3c46446c5a76ad053aec25d19771637ae6d322 /misc
parent20c099bd8e24ff1918b1f16c3c404f064a0dc9cf (diff)
downloadzabbix-6d65c1403d0ee5c56ae5f1a2c58a2c0defa4c665.tar.gz
zabbix-6d65c1403d0ee5c56ae5f1a2c58a2c0defa4c665.tar.xz
zabbix-6d65c1403d0ee5c56ae5f1a2c58a2c0defa4c665.zip
- added alternative startup scripts for Fedora Linux (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@3086 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/init.d/fedora/core/zabbix_agentd113
-rwxr-xr-xmisc/init.d/fedora/core/zabbix_server114
2 files changed, 227 insertions, 0 deletions
diff --git a/misc/init.d/fedora/core/zabbix_agentd b/misc/init.d/fedora/core/zabbix_agentd
new file mode 100755
index 00000000..9fb54a19
--- /dev/null
+++ b/misc/init.d/fedora/core/zabbix_agentd
@@ -0,0 +1,113 @@
+#!/bin/bash
+#
+# chkconfig: - 90 10
+# description: Starts and stops Zabbix Agent using chkconfig
+# Tested on Fedora Core 2 - 5
+# Should work on all Fedora Core versions
+#
+# @name: zabbix_serverd
+# @author: Alexander Hagenah <hagenah@topconcepts.com>
+# @created: 18.04.2006
+#
+# Source function library.
+. /etc/init.d/functions
+
+# Variables
+# Edit these to match your system settings
+
+ # Zabbix-Directory
+ BASEDIR=/opt/zabbix
+
+ # Binary File
+ BINARY_NAME=zabbix_agentd
+
+ # Full Binary File Call
+ FULLPATH=$BASEDIR/bin/$BINARY_NAME
+
+ # PID file
+ PIDFILE=/var/tmp/$BINARY_NAME.pid
+
+ # Establish args
+ ERROR=0
+ STOPPING=0
+
+#
+# No need to edit the things below
+#
+
+# application checking status
+if [ -f $PIDFILE ] && [ -s $PIDFILE ]
+ then
+ PID=`cat $PIDFILE`
+
+ if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null && [ $BINARY_NAME == `ps -e | grep $PID | awk '{print $4}'` ]
+ then
+ STATUS="$BINARY_NAME (pid `pidof $APP`) running.."
+ RUNNING=1
+ else
+ rm -f $PIDFILE
+ STATUS="$BINARY_NAME (pid file existed ($PID) and now removed) not running.."
+ RUNNING=0
+ fi
+else
+ if [ `ps -e | grep $BINARY_NAME | head -1 | awk '{ print $1 }'` ]
+ then
+ STATUS="$BINARY_NAME (pid `pidof $APP`, but no pid file) running.."
+ else
+ STATUS="$BINARY_NAME (no pid file) not running"
+ fi
+ RUNNING=0
+fi
+
+# functions
+start() {
+ if [ $RUNNING -eq 1 ]
+ then
+ echo "$0 $ARG: $BINARY_NAME (pid $PID) already running"
+ else
+ action $"Starting $BINARY_NAME: " $FULLPATH
+ touch /var/lock/subsys/$BINARY_NAME
+ fi
+}
+
+stop() {
+ echo -n $"Shutting down $BINARY_NAME: "
+ killproc $BINARY_NAME
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$BINARY_NAME
+ RUNNING=0
+}
+
+
+# logic
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status $BINARY_NAME
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ help|*)
+ echo $"Usage: $0 {start|stop|status|restart|help}"
+ cat <<EOF
+
+ start - start $BINARY_NAME
+ stop - stop $BINARY_NAME
+ status - show current status of $BINARY_NAME
+ restart - restart $BINARY_NAME if running by sending a SIGHUP or start if not running
+ help - this screen
+
+EOF
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/misc/init.d/fedora/core/zabbix_server b/misc/init.d/fedora/core/zabbix_server
new file mode 100755
index 00000000..648ee008
--- /dev/null
+++ b/misc/init.d/fedora/core/zabbix_server
@@ -0,0 +1,114 @@
+#!/bin/bash
+#
+# chkconfig: - 90 10
+# description: Starts and stops Zabbix Server using chkconfig
+# Tested on Fedora Core 2 - 5
+# Should work on all Fedora Core versions
+#
+# @name: zabbix_serverd
+# @author: Alexander Hagenah <hagenah@topconcepts.com>
+# @created: 18.04.2006
+#
+# Source function library.
+. /etc/init.d/functions
+
+# Variables
+# Edit these to match your system settings
+
+ # Zabbix-Directory
+ BASEDIR=/opt/zabbix
+
+ # Binary File
+ BINARY_NAME=zabbix_server
+
+ # Full Binary File Call
+ FULLPATH=$BASEDIR/bin/$BINARY_NAME
+
+ # PID file
+ PIDFILE=/var/tmp/$BINARY_NAME.pid
+
+ # Establish args
+ ERROR=0
+ STOPPING=0
+
+#
+# No need to edit the things below
+#
+
+# application checking status
+if [ -f $PIDFILE ] && [ -s $PIDFILE ]
+ then
+ PID=`cat $PIDFILE`
+
+ if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null && [ $BINARY_NAME == `ps -e | grep $PID | awk '{print $4}'` ]
+ then
+ STATUS="$BINARY_NAME (pid `pidof $APP`) running.."
+ RUNNING=1
+ else
+ rm -f $PIDFILE
+ STATUS="$BINARY_NAME (pid file existed ($PID) and now removed) not running.."
+ RUNNING=0
+ fi
+else
+ if [ `ps -e | grep $BINARY_NAME | head -1 | awk '{ print $1 }'` ]
+ then
+ STATUS="$BINARY_NAME (pid `pidof $APP`, but no pid file) running.."
+ else
+ STATUS="$BINARY_NAME (no pid file) not running"
+ fi
+ RUNNING=0
+fi
+
+# functions
+start() {
+ if [ $RUNNING -eq 1 ]
+ then
+ echo "$0 $ARG: $BINARY_NAME (pid $PID) already running"
+ else
+ action $"Starting $BINARY_NAME: " $FULLPATH
+ touch /var/lock/subsys/$BINARY_NAME
+ fi
+}
+
+stop() {
+ echo -n $"Shutting down $BINARY_NAME: "
+ killproc $BINARY_NAME
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$BINARY_NAME
+ RUNNING=0
+}
+
+
+# logic
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status $BINARY_NAME
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ help|*)
+ echo $"Usage: $0 {start|stop|status|restart|help}"
+ cat <<EOF
+
+ start - start $BINARY_NAME
+ stop - stop $BINARY_NAME
+ status - show current status of $BINARY_NAME
+ restart - restart $BINARY_NAME if running by sending a SIGHUP or start if not running
+ help - this screen
+
+EOF
+ exit 1
+ ;;
+esac
+
+exit 0
+