tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

FILES_SUBST not working?



In net/nagios-base, I changed the rc.d script to chown a directory to
nagios so that it could write a pid file. This works, but is icky
because it hardcodes the default uid, and I was rightfully dinged for
this privately. The following change intends to fix that, but I find
that the substitution doesn't happen. I'm curious if this works for
anyone else, or if someone can spot the bug in my code.
? net/nagios-base/work
Index: net/nagios-base/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/nagios-base/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- net/nagios-base/Makefile 9 Jun 2008 12:36:15 -0000 1.18
+++ net/nagios-base/Makefile 18 Jun 2008 15:03:56 -0000
@@ -3,7 +3,7 @@
 
 DISTNAME= nagios-2.5
 PKGNAME= ${DISTNAME:S/-/-base-/}
-PKGREVISION= 6
+PKGREVISION= 7
 CATEGORIES= net sysutils
 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=nagios/}
 
@@ -31,6 +31,7 @@ USE_TOOLS+= mail:run perl
 CONFIGURE_ARGS+= --with-mail=${TOOLS_PLATFORM.mail}
 
 RCD_SCRIPTS+= nagios
+FILES_SUBST+= NAGIOS_USER=${NAGIOS_USER:Q}
 
 INSTALL_TARGET= install install-config
 
Index: net/nagios-base/files/nagios.sh
===================================================================
RCS file: /cvsroot/pkgsrc/net/nagios-base/files/nagios.sh,v
retrieving revision 1.5
diff -u -p -r1.5 nagios.sh
--- net/nagios-base/files/nagios.sh 9 Jun 2008 12:36:15 -0000 1.5
+++ net/nagios-base/files/nagios.sh 18 Jun 2008 15:03:56 -0000
@@ -23,7 +23,7 @@ extra_commands="test reload"
 nagios_precmd()
 {
 mkdir -p ${piddir}
- chown nagios ${piddir}
+ chown ${NAGIOS_USER} ${piddir}
 }
 
 nagios_test()


Home | Main Index | Thread Index | Old Index

AltStyle によって変換されたページ (->オリジナル) /