[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: redhat/ fedora specific init script using the distro specific functions

git at icinga.org git at icinga.org
Thu Jul 8 21:01:49 CEST 2010


Module: icinga-core
Branch: mfriedrich/core
Commit: 31f608d6fb990ce397f2bff82d7d9ba5a50d47ba
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=31f608d6fb990ce397f2bff82d7d9ba5a50d47ba

Author: Christoph Maser <cmr at financial.com>
Date:   Fri Feb  5 13:49:26 2010 +0100

redhat/fedora specific init script using the distro specific functions

---

 configure.in          |    2 +-
 daemon-init-redhat.in |  100 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index a0f6946..68bbb15 100644
--- a/configure.in
+++ b/configure.in
@@ -1030,7 +1030,7 @@ else
 fi
 
 
-AC_OUTPUT(Makefile subst pkginfo base/Makefile common/Makefile contrib/Makefile cgi/Makefile html/Makefile module/Makefile module/idoutils/Makefile xdata/Makefile daemon-init rc.ido2db module/idoutils/src/Makefile t-tap/Makefile t/Makefile module/idoutils/db/scripts/installdb module/idoutils/db/scripts/upgradedb module/idoutils/db/scripts/prepsql)
+AC_OUTPUT(Makefile subst pkginfo base/Makefile common/Makefile contrib/Makefile cgi/Makefile html/Makefile module/Makefile module/idoutils/Makefile xdata/Makefile daemon-init daemon-init-redhat rc.ido2db module/idoutils/src/Makefile t-tap/Makefile t/Makefile module/idoutils/db/scripts/installdb module/idoutils/db/scripts/upgradedb module/idoutils/db/scripts/prepsql)
 
 
 perl subst $srcdir/include/locations.h
diff --git a/daemon-init-redhat.in b/daemon-init-redhat.in
new file mode 100644
index 0000000..65c4304
--- /dev/null
+++ b/daemon-init-redhat.in
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# Icinga	Startup script for the Icinga monitoring daemon
+#
+# chkconfig:	85 15
+# description:	Icinga is a service monitoring system
+
+### BEGIN INIT INFO
+# Provides:		icinga
+# Required-Start:	$local_fs $syslog $network
+# Default-Start:	3 4 5
+# Default-Stop: 	0 1 6
+# Short-Description:    start and stop Icinga monitoring server
+# Description:		Icinga is is a service monitoring system 
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+exec="@bindir@/icinga"
+prog="icinga"
+config="@sysconfdir@/icinga.cfg"
+pidfile="@lockfile@"
+user="@icinga_user@"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user=$user $exec -d $config
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p ${pidfile} -d 10 $exec
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    echo -n $"Reloading $prog: "
+    killproc -p ${pidfile} $exec -HUP
+    RETVAL=$?
+    echo
+}
+
+force_reload() {
+    restart
+}
+
+case "$1" in
+    start)
+        status $prog && exit 0
+        $1
+        ;;
+    stop)
+        status $prog|| exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        status $prog || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        status $prog
+        ;;
+    condrestart|try-restart)
+        status $prog|| exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
+





More information about the icinga-checkins mailing list