2 # Copyright 1999-2012 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
5 : ${ICINGACFG:=/etc/icinga/icinga.cfg}
7 extra_commands="checkconfig"
8 extra_started_commands="reload"
10 command=/usr/sbin/icinga
11 command_args="-d ${ICINGACFG}"
14 if [ -e "${ICINGACFG}" ]; then
15 sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' "${ICINGACFG}"
19 pidfile=$(get_config lock_file)
20 start_stop_daemon_args="-e HOME=/var/lib/icinga"
24 use dns logger firewall mysql postgresql
29 ${command} -v ${ICINGACFG} &>/dev/null && return 0
30 # Now we know there's problem - run again and display errors
31 ${command} -v ${ICINGACFG}
32 eend $? "Configuration Error. Please fix your configfile"
37 checkconfig || return 1
38 ebegin "Reloading configuration"
39 kill -HUP $(cat ${pidfile}) &>/dev/null
44 checkpath -d -o icinga:icinga $(get_config temp_path) $(dirname $(get_config lock_file)) $(dirname $(get_config log_file)) $(dirname $(get_config status_file))
45 checkpath -f -o icinga:icinga $(get_config log_file)
46 rm -f $(get_config command_file)
50 rm -f $(get_config command_file)
55 checkconfig || return 1
56 ebegin "Restarting icinga"