Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/nagios-nsca/files: nsca.conf nsca.init
Date: Thu, 23 Aug 2012 21:23:52
Message-Id: 20120823212331.E0D47204CB@flycatcher.gentoo.org
1 flameeyes 12/08/23 21:23:31
2
3 Modified: nsca.init
4 Added: nsca.conf
5 Log:
6 Revision bump: add a minimal USE flag to only build send_nsca instead of the daemon; add a dependency on either nagios or icinga for the non-minimal install; install a configuration file with icinga defaults (user/group and paths); allow changing the configuration file for the init script (install conf.d file for that) and depend properly on icinga/nagios.
7
8 (Portage version: 2.2.0_alpha121/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.3 net-analyzer/nagios-nsca/files/nsca.init
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.init?rev=1.3&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.init?rev=1.3&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.init?r1=1.2&r2=1.3
16
17 Index: nsca.init
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.init,v
20 retrieving revision 1.2
21 retrieving revision 1.3
22 diff -u -r1.2 -r1.3
23 --- nsca.init 21 Aug 2012 17:30:54 -0000 1.2
24 +++ nsca.init 23 Aug 2012 21:23:31 -0000 1.3
25 @@ -1,26 +1,35 @@
26 #!/sbin/runscript
27 # Copyright 1999-2012 Gentoo Foundation
28 # Distributed under the terms of the GNU General Public License v2
29 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.init,v 1.2 2012/08/21 17:30:54 flameeyes Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.init,v 1.3 2012/08/23 21:23:31 flameeyes Exp $
31
32 -get_pidfile() {
33 - sed -n -e 's:^[ \t]*pid_file=\([^#]\+\).*:\1:p' \
34 - /etc/nagios/nsca.cfg
35 +: ${CFGFILE:=/etc/nagios/nsca.cfg}
36 +
37 +get_config() {
38 + [ -f ${CFGFILE} ] || return 1
39 +
40 + sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' \
41 + ${CFGFILE}
42 }
43
44 extra_started_commands="reload"
45
46 command=/usr/libexec/${SVCNAME}
47 -command_args="-c /etc/nagios/nsca.cfg --daemon"
48 -pidfile=$(get_pidfile)
49 +command_args="-c ${CFGFILE} --daemon"
50 +pidfile=$(get_config pid_file)
51
52 depend() {
53 + config ${CFGFILE}
54 +
55 need net
56 - use icinga nagios
57 + case $(get_config nsca_user) in
58 + icinga) need icinga ;;
59 + nagios) need nagios ;;
60 + esac
61 }
62
63 reload() {
64 ebegin "Reloading nsca"
65 - kill -HUP `cat $(get_pidfile)`
66 + kill -HUP `cat $(get_config pid_file)`
67 eend $? "Failed to reload nsca"
68 }
69
70
71
72 1.1 net-analyzer/nagios-nsca/files/nsca.conf
73
74 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.conf?rev=1.1&view=markup
75 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-nsca/files/nsca.conf?rev=1.1&content-type=text/plain
76
77 Index: nsca.conf
78 ===================================================================
79 # Choose the configuration file to use; the pre-defined configurations
80 # for Nagios and Icinga are available in their respective directories:
81 # /etc/nagios/nsca.cfg
82 # /etc/icinga/nsca.cfg
83 CFGFILE=/etc/nagios/nsca.cfg