[csw-devel] SF.net SVN: gar:[7509] csw/mgar/pkg/bind/trunk

bonivart at users.sourceforge.net bonivart at users.sourceforge.net
Mon Nov 30 18:20:38 CET 2009


Revision: 7509
          http://gar.svn.sourceforge.net/gar/?rev=7509&view=rev
Author:   bonivart
Date:     2009-11-30 17:20:19 +0000 (Mon, 30 Nov 2009)

Log Message:
-----------
bind: fix chroot stuff

Modified Paths:
--------------
    csw/mgar/pkg/bind/trunk/Makefile
    csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed
    csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall

Modified: csw/mgar/pkg/bind/trunk/Makefile
===================================================================
--- csw/mgar/pkg/bind/trunk/Makefile	2009-11-30 16:13:46 UTC (rev 7508)
+++ csw/mgar/pkg/bind/trunk/Makefile	2009-11-30 17:20:19 UTC (rev 7509)
@@ -70,8 +70,8 @@
 	{ print }'
 
 INITSMF = /etc/opt/csw/init.d/cswnamed
-SAMPLECONF = /etc/opt/csw/named.conf /etc/opt/csw/CSWbind/bind
-USERGROUP = /etc/opt/csw/CSWbind/cswusergroup
+SAMPLECONF = /etc/opt/csw/named.conf /etc/opt/csw/pkg/CSWbind/bind
+USERGROUP = /etc/opt/csw/pkg/CSWbind/cswusergroup
 
 SPKG_SOURCEURL = http://www.isc.org/software/bind
 
@@ -88,9 +88,9 @@
 	@ginstall -m 755 -d $(DESTDIR)/etc/opt/csw/init.d
 	@ginstall -m 755 $(FILEDIR)/CSWbind.cswnamed $(DESTDIR)/etc/opt/csw/init.d/cswnamed
 	@ginstall -m 644 $(FILEDIR)/CSWbind.named.conf.CSW $(DESTDIR)/etc/opt/csw/named.conf
-	@ginstall -m 755 -d $(DESTDIR)/etc/opt/csw/CSWbind
-	@ginstall -m 444 $(FILEDIR)/cswusergroup $(DESTDIR)/etc/opt/csw/CSWbind/
-	@ginstall -m 644 $(FILEDIR)/bind.CSW $(DESTDIR)/etc/opt/csw/CSWbind/bind
+	@ginstall -m 755 -d $(DESTDIR)/etc/opt/csw/pkg/CSWbind
+	@ginstall -m 444 $(FILEDIR)/cswusergroup $(DESTDIR)/etc/opt/csw/pkg/CSWbind/
+	@ginstall -m 644 $(FILEDIR)/bind.CSW $(DESTDIR)/etc/opt/csw/pkg/CSWbind/bind
 	@ginstall -m 755 -d $(DESTDIR)$(docdir)/$(GARNAME)
 	@$(foreach DOC,$(DOCLIST),cp $(FILEDIR)/$(DOC) $(DESTDIR)$(docdir)/$(GARNAME);)
 	( cd $(WORKSRC) ; \

Modified: csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed
===================================================================
--- csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed	2009-11-30 16:13:46 UTC (rev 7508)
+++ csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed	2009-11-30 17:20:19 UTC (rev 7509)
@@ -11,12 +11,6 @@
 #OPTIONS="-c /opt/csw/etc/named.conf" # use old location of conf file
 OPTIONS="-u $USER"
 
-if [ -r /etc/opt/csw/pkg/CSWbind/bind && /bin/egrep -q '^ROOTDIR=' /etc/opt/csw/pkg/CSWbind/bind ]; then
-  :;
-else
-  echo ROOTDIR="/var/named/chroot" >> /etc/sysconfig/named;
-fi
-
 # Source config file
 [ -r /etc/opt/csw/pkg/CSWbind/bind ] && . /etc/opt/csw/pkg/CSWbind/bind
 
@@ -25,13 +19,17 @@
 case "$1" in
   start)
     if [ -f /opt/csw/sbin/named -a -f /etc/opt/csw/named.conf ]; then
-      echo 'Starting bind.'
+      echo "Starting bind."
+      if [ -n "$ROOTDIR" ]; then
+        echo ROOTDIR set to $ROOTDIR
+        ROOTDIR="-t $ROOTDIR"
+      fi
       # ulimit -n 1024
       /opt/csw/sbin/named $OPTIONS $ROOTDIR &
     fi
     ;;
   stop)
-    echo 'Shutting down bind.'
+    echo "Shutting down bind."
     if [ -x /usr/bin/zonename ]; then
       if [ "`/usr/bin/zonename`" = "global" ]; then
         ZONE="-z global"
@@ -40,7 +38,7 @@
     pkill $ZONE -x named
     ;;
   reload|refresh)
-    echo 'Reloading bind.'
+    echo "Reloading bind."
     if [ -x /usr/bin/zonename ]; then
       if [ "`/usr/bin/zonename`" = "global" ]; then
         ZONE="-z global"

Modified: csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall
===================================================================
--- csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall	2009-11-30 16:13:46 UTC (rev 7508)
+++ csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall	2009-11-30 17:20:19 UTC (rev 7509)
@@ -12,7 +12,7 @@
   MAJOR=`echo $DEVICE | awk '{print $5}' | awk -F',' '{print $1}'`
   MINOR=`echo $DEVICE | awk '{print $6}'`
   echo "Creating device $i ($MAJOR,$MINOR)"
-  mknod $ROOTDIR/dev/$i $MAJOR $MINOR
+  mknod $ROOTDIR/dev/$i c $MAJOR $MINOR
 done
 
 # Copy config from /etc/opt/csw
@@ -24,11 +24,11 @@
 # change owner on all files/dirs under /var/opt/csw/named/chroot
 chown -R named:named $ROOTDIR
 
-# show info about svc
+# show info
 echo
 echo "System prepared for chrooted BIND."
 echo
 echo "Move your zone files into $ROOTDIR/var/named"
-echo "and your rndc keys and so on into $ROOTDIR/etc/opt/csw."
+echo "and your rndc key into $ROOTDIR/etc/opt/csw."
 echo
-echo "The directory option in named.conf must be set to $ROOTDIR/var/named."
+echo "The directory option in named.conf must be set to /var/named."


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list