Index: package_branches/invirt-base/hvirt/debian/changelog
===================================================================
--- package_branches/invirt-base/hvirt/debian/changelog	(revision 2788)
+++ package_branches/invirt-base/hvirt/debian/changelog	(revision 2840)
@@ -1,6 +1,7 @@
-invirt-base (0.0.29) unstable; urgency=low
+invirt-base (0.0.29hvirt1) unstable; urgency=low
 
   * Added debathena SSH and KRB5 config
   * Added init script to regen kerberos config
+  * Have init script operate in the style of xvm-munin-config
 
  -- Greg Brockman <gdb@mit.edu>  Thu, 24 Dec 2009 20:13:20 -0500
Index: package_branches/invirt-base/hvirt/debian/invirt-base.init
===================================================================
--- package_branches/invirt-base/hvirt/debian/invirt-base.init	(revision 2788)
+++ package_branches/invirt-base/hvirt/debian/invirt-base.init	(revision 2840)
@@ -11,8 +11,10 @@
 
 # Author: Invirt Project <invirt@mit.edu>
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
-if [ -x /usr/bin/invirt-getconf -a -f /etc/krb5.conf.invirt ]; then
-    /usr/bin/perl -i -e '$r = `/usr/bin/invirt-getconf kerberos.realm`; chomp($r);
-      while(<>) { s/^([ \t]*default_realm *=).*$/\1 $r/m; print; }' /etc/krb5.conf.invirt
-fi
+PACKAGE=invirt-base
+GEN_FILES=/etc/krb5.conf.invirt
+
+dpkg -s "$PACKAGE" >/dev/null 2>/dev/null || exit 0
+
+. /lib/init/config-init.sh
+config_init "$1"
Index: package_branches/invirt-base/hvirt/debian/invirt-base.install
===================================================================
--- package_branches/invirt-base/hvirt/debian/invirt-base.install	(revision 2788)
+++ package_branches/invirt-base/hvirt/debian/invirt-base.install	(revision 2840)
@@ -1,2 +1,4 @@
 files/* .
 debian/sshd_config.invirt etc/ssh/
+debian/krb5.conf.invirt.mako etc/
+
Index: package_branches/invirt-base/hvirt/debian/rules
===================================================================
--- package_branches/invirt-base/hvirt/debian/rules	(revision 2788)
+++ package_branches/invirt-base/hvirt/debian/rules	(revision 2840)
@@ -6,8 +6,10 @@
 DEB_CHECK_FILES_SOURCE_/etc/krb5.conf.invirt = \
         /usr/share/kerberos-configs/krb5.conf.template
-DEB_TRANSFORM_FILES_invirt-base += \
+DEB_DIVERT_FILES_invirt-base += \
+        /etc/ssh/sshd_config.invirt \
         /etc/krb5.conf.invirt
-DEB_DIVERT_FILES_invirt-base += \
-        /etc/ssh/sshd_config.invirt
+
+DEB_DH_INSTALLINIT_ARGS += --no-start
+DEB_UPDATE_RCD_PARAMS_invirt-base += defaults 20 80
 
 include /usr/share/cdbs/1/rules/debhelper.mk
@@ -18,5 +20,5 @@
 	mv $(DEB_DESTDIR)usr/bin/invirt-reload $(DEB_DESTDIR)usr/sbin/invirt-reload
 
-common-build-indep:: debian/sshd_config.invirt
+common-build-indep:: debian/sshd_config.invirt debian/krb5.conf.invirt.mako
 
 # Stolen from Debathena
@@ -34,4 +36,7 @@
 s/^#?PasswordAuthentication .*$$/PasswordAuthentication no/m or die;' $< > $@
 
+debian/krb5.conf.invirt.mako: $(call debian_check_files,/etc/krb5.conf)
+	debian/transform_krb5.conf.invirt.mako < $< > $@
+
 clean::
 	rm -rf python/invirt.egg-info
Index: package_branches/invirt-base/hvirt/debian/transform_krb5.conf.invirt
===================================================================
--- package_branches/invirt-base/hvirt/debian/transform_krb5.conf.invirt	(revision 2788)
+++ 	(revision )
@@ -1,25 +1,0 @@
-#!/usr/bin/perl -p0
-# Debathena rules (from debathena-kerberos-config)
-s/^([ \t]*default_realm *=).*$/\1 ATHENA.MIT.EDU/m or die;
-s/(\[realms\][^[]*\n)[ \t]*NUMENOR\.MIT\.EDU\s*=\s*\{[^}]*\}\s*\n/\1/;
-s/(\[realms\]\n)/\1\tNUMENOR.MIT.EDU = {\n\t\tkdc = numenor.mit.edu\n\t\tadmin_server = numenor.mit.edu\n\t}\n/ or die;
-s/(\[realms\][^[]*\n)[ \t]*CSAIL\.MIT\.EDU\s*=\s*\{[^}]*\}\s*\n/\1/;
-s/(\[realms\]\n)/\1\tCSAIL.MIT.EDU = {\n\t\tkdc = kerberos-1.csail.mit.edu\n\t\tkdc = kerberos-2.csail.mit.edu\n\t\tadmin_server = kerberos.csail.mit.edu\n\t\tdefault_domain = csail.mit.edu\n\t\tkrb524_server = krb524.csail.mit.edu\n\t}\n/ or die;
-s/(\[realms\][^[]*\n)[ \t]*ATHENA\.MIT\.EDU\s*=\s*\{[^}]*\}\s*\n/\1/;
-s/(\[realms\]\n)/\1\tATHENA.MIT.EDU = {\n\t\tkdc = kerberos.mit.edu:88\n\t\tkdc = kerberos-1.mit.edu:88\n\t\tkdc = kerberos-2.mit.edu:88\n\t\tadmin_server = kerberos.mit.edu\n\t\tdefault_domain = mit.edu\n\t}\n/ or die;
-s/(\[domain_realm\][^[]*\n)[ \t]*numenor\.mit\.edu\s*=[^\n]*\n/\1/;
-s/(\[domain_realm\]\n)/\1\tnumenor.mit.edu = NUMENOR.MIT.EDU\n/ or die;
-s/(\[domain_realm\][^[]*\n)[ \t]*csail\.mit\.edu\s*=[^\n]*\n/\1/;
-s/(\[domain_realm\]\n)/\1\tcsail.mit.edu = CSAIL.MIT.EDU\n/ or die;
-s/(\[domain_realm\][^[]*\n)[ \t]*\.csail\.mit\.edu\s*=[^\n]*\n/\1/;
-s/(\[domain_realm\]\n)/\1\t.csail.mit.edu = CSAIL.MIT.EDU\n/ or die;
-s/(\[domain_realm\][^[]*\n)[ \t]*mit\.edu\s*=[^\n]*\n/\1/;
-s/(\[domain_realm\]\n)/\1\tmit.edu = ATHENA.MIT.EDU\n/ or die;
-s/(\[domain_realm\][^[]*\n)[ \t]*\.mit\.edu\s*=[^\n]*\n/\1/;
-s/(\[domain_realm\]\n)/\1\t.mit.edu = ATHENA.MIT.EDU\n/ or die;
-
-# Invirt rules
-
-s/(\[realms\]\n)/\1\tHCS.HARVARD.EDU = {\n\t\tkdc = krb1.hcs.harvard.edu\n\t\tadmin_server = krb1.hcs.harvard.edu\n\t}\n/ or die;
-s/(\[domain_realm\]\n)/\1\thcs.harvard.edu = HCS.HARVARD.EDU\n/ or die;
-s/(\[domain_realm\]\n)/\1\t.hcs.harvard.edu = HCS.HARVARD.EDU\n/ or die;
Index: package_branches/invirt-base/hvirt/debian/transform_krb5.conf.invirt.mako
===================================================================
--- package_branches/invirt-base/hvirt/debian/transform_krb5.conf.invirt.mako	(revision 2840)
+++ package_branches/invirt-base/hvirt/debian/transform_krb5.conf.invirt.mako	(revision 2840)
@@ -0,0 +1,34 @@
+#!/usr/bin/perl -p0
+BEGIN {
+    print <<'EOF';
+<%
+from invirt.config import structs as cfg
+%>
+EOF
+}
+
+s/^([ \t]*default_realm *=).*$/\1 \${cfg.kerberos.realm}/m or die;
+
+# Debathena rules (from debathena-kerberos-config)
+s/(\[realms\][^[]*\n)[ \t]*NUMENOR\.MIT\.EDU\s*=\s*\{[^}]*\}\s*\n/\1/;
+s/(\[realms\]\n)/\1\tNUMENOR.MIT.EDU = {\n\t\tkdc = numenor.mit.edu\n\t\tadmin_server = numenor.mit.edu\n\t}\n/ or die;
+s/(\[realms\][^[]*\n)[ \t]*CSAIL\.MIT\.EDU\s*=\s*\{[^}]*\}\s*\n/\1/;
+s/(\[realms\]\n)/\1\tCSAIL.MIT.EDU = {\n\t\tkdc = kerberos-1.csail.mit.edu\n\t\tkdc = kerberos-2.csail.mit.edu\n\t\tadmin_server = kerberos.csail.mit.edu\n\t\tdefault_domain = csail.mit.edu\n\t\tkrb524_server = krb524.csail.mit.edu\n\t}\n/ or die;
+s/(\[realms\][^[]*\n)[ \t]*ATHENA\.MIT\.EDU\s*=\s*\{[^}]*\}\s*\n/\1/;
+s/(\[realms\]\n)/\1\tATHENA.MIT.EDU = {\n\t\tkdc = kerberos.mit.edu:88\n\t\tkdc = kerberos-1.mit.edu:88\n\t\tkdc = kerberos-2.mit.edu:88\n\t\tadmin_server = kerberos.mit.edu\n\t\tdefault_domain = mit.edu\n\t}\n/ or die;
+s/(\[domain_realm\][^[]*\n)[ \t]*numenor\.mit\.edu\s*=[^\n]*\n/\1/;
+s/(\[domain_realm\]\n)/\1\tnumenor.mit.edu = NUMENOR.MIT.EDU\n/ or die;
+s/(\[domain_realm\][^[]*\n)[ \t]*csail\.mit\.edu\s*=[^\n]*\n/\1/;
+s/(\[domain_realm\]\n)/\1\tcsail.mit.edu = CSAIL.MIT.EDU\n/ or die;
+s/(\[domain_realm\][^[]*\n)[ \t]*\.csail\.mit\.edu\s*=[^\n]*\n/\1/;
+s/(\[domain_realm\]\n)/\1\t.csail.mit.edu = CSAIL.MIT.EDU\n/ or die;
+s/(\[domain_realm\][^[]*\n)[ \t]*mit\.edu\s*=[^\n]*\n/\1/;
+s/(\[domain_realm\]\n)/\1\tmit.edu = ATHENA.MIT.EDU\n/ or die;
+s/(\[domain_realm\][^[]*\n)[ \t]*\.mit\.edu\s*=[^\n]*\n/\1/;
+s/(\[domain_realm\]\n)/\1\t.mit.edu = ATHENA.MIT.EDU\n/ or die;
+
+# Invirt rules
+
+s/(\[realms\]\n)/\1\tHCS.HARVARD.EDU = {\n\t\tkdc = krb1.hcs.harvard.edu\n\t\tadmin_server = krb1.hcs.harvard.edu\n\t}\n/ or die;
+s/(\[domain_realm\]\n)/\1\thcs.harvard.edu = HCS.HARVARD.EDU\n/ or die;
+s/(\[domain_realm\]\n)/\1\t.hcs.harvard.edu = HCS.HARVARD.EDU\n/ or die;
