diff options
author | 2011-11-21 23:54:06 +0000 | |
---|---|---|
committer | 2011-11-21 23:54:06 +0000 | |
commit | bc2b9067a56f5c0875520cc69374624044f44dd3 (patch) | |
tree | e5230863cff239bee9cb8369f7012af39a9162ea /net-analyzer/icinga/files | |
parent | Version bump (diff) | |
download | historical-bc2b9067a56f5c0875520cc69374624044f44dd3.tar.gz historical-bc2b9067a56f5c0875520cc69374624044f44dd3.tar.bz2 historical-bc2b9067a56f5c0875520cc69374624044f44dd3.zip |
Commit to fix bug 391143
Package-Manager: portage-2.1.10.11/cvs/Linux x86_64
Diffstat (limited to 'net-analyzer/icinga/files')
-rwxr-xr-x | net-analyzer/icinga/files/icinga-init.d-2 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/net-analyzer/icinga/files/icinga-init.d-2 b/net-analyzer/icinga/files/icinga-init.d-2 new file mode 100755 index 000000000000..ced093919723 --- /dev/null +++ b/net-analyzer/icinga/files/icinga-init.d-2 @@ -0,0 +1,51 @@ +#!/sbin/runscript + +opts="${opts} reload checkconfig" + +depend() { + need net + use dns logger firewall + after mysql postgresql +} + +reload() +{ + checkconfig || return 1 + ebegin "Reloading configuration" + kill -HUP `cat /var/run/icinga/icinga.lock` &>/dev/null + eend $? +} + +checkconfig() { + # Silent Check + /usr/sbin/icinga -v /etc/icinga/icinga.cfg &>/dev/null && return 0 + # Now we know there's problem - run again and display errors + /usr/sbin/icinga -v /etc/icinga/icinga.cfg + eend $? "Configuration Error. Please fix your configfile" +} + +start() { + checkconfig || return 1 + ebegin "Starting icinga" + checkpath -d -o icinga:icinga /tmp/icinga /var/run/icinga /var/log/icinga /var/icinga + checkpath -f -o icinga:icinga /var/log/icinga/icinga.log + rm -f /var/icinga/rw/icinga.cmd + start-stop-daemon --start --exec /usr/sbin/icinga -e HOME="/var/icinga/home" --pidfile /var/run/icinga/icinga.lock -- -d /etc/icinga/icinga.cfg + eend $? +} + +stop() { + ebegin "Stopping icinga" + start-stop-daemon --stop --pidfile /var/run/icinga/icinga.lock + rm -f /var/icinga/status.log /var/run/icinga/icinga.lock /var/icinga/rw/icinga.cmd + rm -r /tmp/icinga + eend $? +} + +svc_restart() { + checkconfig || return 1 + ebegin "Restarting icinga" + svc_stop + svc_start + eend $? +} |