blob: 627cc50665ea4ffd3f9b057852405d27ddc696e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!/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/icinga-core/files/icinga3,v 1.1 2008/04/27 18:41:25 dertobi123 Exp $
opts="${opts} reload checkconfig"
depend() {
need net
use dns logger firewall
after mysql postgresql
}
reload()
{
checkconfig || return 1
ebegin "Reloading configuration"
killall -HUP icinga &>/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"
touch /var/icinga/icinga.log /var/icinga/status.sav
chown icinga:icinga /var/icinga/icinga.log /var/icinga/status.sav
rm -f /var/icinga/rw/icinga.cmd
start-stop-daemon --quiet --start --startas /usr/sbin/icinga \
-e HOME="/var/icinga/home" --pidfile /var/icinga/icinga.lock \
-- -d /etc/icinga/icinga.cfg
eend $?
}
stop() {
ebegin "Stopping icinga"
start-stop-daemon --quiet --stop --pidfile /var/icinga/icinga.lock
rm -f /var/icinga/status.log /var/icinga/icinga.tmp /var/icinga/icinga.lock /var/icinga/rw/icinga.cmd
eend $?
}
svc_restart() {
checkconfig || return 1
ebegin "Restarting icinga"
svc_stop
svc_start
eend $?
}
|