Index: trunk/packages/sipb-xen-base/debian/changelog
===================================================================
--- trunk/packages/sipb-xen-base/debian/changelog	(revision 1209)
+++ trunk/packages/sipb-xen-base/debian/changelog	(revision 1211)
@@ -1,2 +1,8 @@
+sipb-xen-base (8.25) unstable; urgency=low
+
+  * Factor out common initscript code, provide it here
+
+ -- Greg Price <price@mit.edu>  Fri, 24 Oct 2008 07:06:59 -0400
+
 sipb-xen-base (8.24) unstable; urgency=low
 
Index: trunk/packages/sipb-xen-base/files/lib/init/config-init.sh
===================================================================
--- trunk/packages/sipb-xen-base/files/lib/init/config-init.sh	(revision 1211)
+++ trunk/packages/sipb-xen-base/files/lib/init/config-init.sh	(revision 1211)
@@ -0,0 +1,33 @@
+# For a package which only configures another, "parent" package.
+#
+# Global variable PARENTPACKAGE names parent; may be array
+# for zero or many parents.
+#
+# Global variable PACKAGE names this package, for log message.
+#
+# Requires bash.
+
+. /lib/init/vars.sh
+. /lib/lsb/init-functions
+. /lib/init/gen-files.sh
+
+config_init () {
+  case "$1" in
+    start|reload|force-reload|restart)
+      log_begin_msg "Reloading config for $PACKAGE"
+      gen_files
+      log_end_msg $?
+      for p in "${PARENTPACKAGE[@]}"; do
+        /etc/init.d/"$p" "$1"
+      done
+      ;;
+    stop)
+      for p in "${PARENTPACKAGE[@]}"; do
+        /etc/init.d/"$p" "$1"
+      done
+      ;;
+    *)
+      log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}"
+      ;;
+  esac
+}
Index: trunk/packages/sipb-xen-base/files/lib/init/gen-files.sh
===================================================================
--- trunk/packages/sipb-xen-base/files/lib/init/gen-files.sh	(revision 1211)
+++ trunk/packages/sipb-xen-base/files/lib/init/gen-files.sh	(revision 1211)
@@ -0,0 +1,9 @@
+# Generates files from templates.
+# Files should be named in an array variable GEN_FILES.
+
+gen_files()
+{
+  for f in "${GEN_FILES[@]}"; do
+    mako-render $f.mako >$f
+  done
+}
