In rc.d script, mkdir and chown /var/run/nagios so that nagios can write the pid file. PKGREVISION++. OK tonnerre@.diff -r1.17 -r1.18 pkgsrc/net/nagios-base/Makefile
(gdt)
@@ -1,19 +1,19 @@ | @@ -1,19 +1,19 @@ | |||
1 | # $NetBSD: Makefile,v 1.17 2008/03/18 21:53:41 tonnerre Exp $ | 1 | # $NetBSD: Makefile,v 1.18 2008/06/09 12:36:15 gdt Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | DISTNAME= nagios-2.5 | 4 | DISTNAME= nagios-2.5 | |
5 | PKGNAME= ${DISTNAME:S/-/-base-/} | 5 | PKGNAME= ${DISTNAME:S/-/-base-/} | |
6 | PKGREVISION= 5 | 6 | PKGREVISION= 6 | |
7 | CATEGORIES= net sysutils | 7 | CATEGORIES= net sysutils | |
8 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=nagios/} | 8 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=nagios/} | |
9 | 9 | |||
10 | MAINTAINER= tonnerre@NetBSD.org | 10 | MAINTAINER= tonnerre@NetBSD.org | |
11 | HOMEPAGE= http://www.nagios.org/ | 11 | HOMEPAGE= http://www.nagios.org/ | |
12 | COMMENT= Network monitor | 12 | COMMENT= Network monitor | |
13 | 13 | |||
14 | .include "../../mk/bsd.prefs.mk" | 14 | .include "../../mk/bsd.prefs.mk" | |
15 | .include "../../net/nagios-base/Makefile.common" | 15 | .include "../../net/nagios-base/Makefile.common" | |
16 | .include "options.mk" | 16 | .include "options.mk" | |
17 | 17 | |||
18 | CONFIGURE_ARGS+= --with-gd-lib=${LOCALBASE}/lib | 18 | CONFIGURE_ARGS+= --with-gd-lib=${LOCALBASE}/lib | |
19 | CONFIGURE_ARGS+= --with-gd-inc=${LOCALBASE}/include | 19 | CONFIGURE_ARGS+= --with-gd-inc=${LOCALBASE}/include |
@@ -1,27 +1,35 @@ | @@ -1,27 +1,35 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: nagios.sh,v 1.4 2007/11/26 22:14:14 seb Exp $ | 3 | # $NetBSD: nagios.sh,v 1.5 2008/06/09 12:36:15 gdt Exp $ | |
4 | # | 4 | # | |
5 | # PROVIDE: nagios | 5 | # PROVIDE: nagios | |
6 | # REQUIRE: DAEMON | 6 | # REQUIRE: DAEMON | |
7 | 7 | |||
8 | . /etc/rc.subr | 8 | . /etc/rc.subr | |
9 | 9 | |||
10 | name="nagios" | 10 | name="nagios" | |
11 | rcvar=$name | 11 | rcvar=$name | |
12 | command="@PREFIX@/bin/${name}" | 12 | command="@PREFIX@/bin/${name}" | |
13 | pidfile="/var/run/${name}.lock" | 13 | piddir="/var/run/${name}" | |
14 | pidfile="${piddir}/${name}.lock" | |||
14 | config="@PKG_SYSCONFDIR@/${name}.cfg" | 15 | config="@PKG_SYSCONFDIR@/${name}.cfg" | |
15 | 16 | |||
16 | command_args="-d $config" | 17 | command_args="-d $config" | |
17 | 18 | |||
19 | start_precmd="nagios_precmd" | |||
18 | test_cmd="nagios_test" | 20 | test_cmd="nagios_test" | |
19 | extra_commands="test reload" | 21 | extra_commands="test reload" | |
20 | 22 | |||
23 | nagios_precmd() | |||
24 | { | |||
25 | mkdir -p ${piddir} | |||
26 | chown nagios ${piddir} | |||
27 | } | |||
28 | ||||
21 | nagios_test() | 29 | nagios_test() | |
22 | { | 30 | { | |
23 | $command -v $config | 31 | $command -v $config | |
24 | } | 32 | } | |
25 | 33 | |||
26 | load_rc_config $name | 34 | load_rc_config $name | |
27 | run_rc_command "$1" | 35 | run_rc_command "$1" |