summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEldad Zack <eldad@gentoo.org>2004-10-20 16:37:55 +0000
committerEldad Zack <eldad@gentoo.org>2004-10-20 16:37:55 +0000
commitc5735cb1a2e045fe6d16cf3fee2e3cb3fa0de794 (patch)
treee11bf9ffa2b0e8ffb3b59877906d81926ca9c769 /net-analyzer/nagios-core/files
parentRemoved EDS support since evolution-data-server is not stable on any arch (diff)
downloadhistorical-c5735cb1a2e045fe6d16cf3fee2e3cb3fa0de794.tar.gz
historical-c5735cb1a2e045fe6d16cf3fee2e3cb3fa0de794.tar.bz2
historical-c5735cb1a2e045fe6d16cf3fee2e3cb3fa0de794.zip
init.d script fixes, bug #67955
Diffstat (limited to 'net-analyzer/nagios-core/files')
-rw-r--r--net-analyzer/nagios-core/files/nagios24
1 files changed, 23 insertions, 1 deletions
diff --git a/net-analyzer/nagios-core/files/nagios b/net-analyzer/nagios-core/files/nagios
index fd8c0aa2b0d0..20930037cab3 100644
--- a/net-analyzer/nagios-core/files/nagios
+++ b/net-analyzer/nagios-core/files/nagios
@@ -1,14 +1,34 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/files/nagios,v 1.5 2004/07/14 23:04:37 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/files/nagios,v 1.6 2004/10/20 16:37:55 eldad Exp $
+
+opts="${opts} reload checkconfig"
depend() {
need net
use dns logger
}
+reload()
+{
+ checkconfig || return 1
+ ebegin "Reloading configuration"
+ killall -HUP nagios &>/dev/null
+ eend $?
+}
+
+checkconfig() {
+ # Silent Check
+ /usr/nagios/bin/nagios -v /etc/nagios/nagios.cfg &>/dev/null && return 0
+
+ # Now we know there's problem - run again and display errors
+ /usr/nagios/bin/nagios -v /etc/nagios/nagios.cfg
+ eend $? "Configuration Error. Please fix your configfile"
+}
+
start() {
+ checkconfig || return 1
ebegin "Starting nagios"
touch /var/nagios/nagios.log /var/nagios/status.sav
chown nagios:nagios /var/nagios/nagios.log /var/nagios/status.sav
@@ -26,8 +46,10 @@ stop() {
}
svc_restart() {
+ checkconfig || return 1
ebegin "Restarting nagios"
svc_stop
svc_start
eend $?
}
+