Index: trunk/packages/sipb-xen-console/config.todo
===================================================================
--- trunk/packages/sipb-xen-console/config.todo	(revision 842)
+++ trunk/packages/sipb-xen-console/config.todo	(revision 843)
@@ -1,3 +1,2 @@
-files/etc/nss-pgsql.conf
 files/etc/issue.net.no_tkt
 files/etc/lots: could benefit from config-package-dev TRANSFORM for upgradeability
Index: trunk/packages/sipb-xen-console/debian/changelog
===================================================================
--- trunk/packages/sipb-xen-console/debian/changelog	(revision 842)
+++ trunk/packages/sipb-xen-console/debian/changelog	(revision 843)
@@ -1,2 +1,11 @@
+sipb-xen-console (7.7) unstable; urgency=low
+
+  * sipb_xen_database -> invirt.database
+  * use invirt config in sipb-xen-consolefs
+  * added decomposition of DB URI
+  * generate nss-pgsql.conf from debian init script
+
+ -- Yang Zhang <y_z@mit.edu>  Sun,  3 Aug 2008 01:13:37 -0400
+
 sipb-xen-console (7.6) unstable; urgency=low
 
Index: trunk/packages/sipb-xen-console/debian/sipb-xen-console.init
===================================================================
--- trunk/packages/sipb-xen-console/debian/sipb-xen-console.init	(revision 842)
+++ trunk/packages/sipb-xen-console/debian/sipb-xen-console.init	(revision 843)
@@ -1,3 +1,3 @@
-#! /bin/sh
+#!/bin/bash
 ### BEGIN INIT INFO
 # Provides:          sipb-xen-console
@@ -38,13 +38,35 @@
 gen_config()
 {
-        (for i in $(invirt-getconf --ls hosts); do
-		hostname=$(invirt-getconf hosts.$i.hostname)
-		echo "#include /etc/conserver/conf.d/$hostname"
-	done) >/etc/conserver/invirt-hosts.cf
-	realm=$(invirt-getconf authn.0.realm)
-        (for i in $(invirt-getconf --ls hosts); do
-		hostname=$(invirt-getconf hosts.$i.hostname)
-		echo "host/$hostname@$realm"
-	done) >/etc/remctl/acl/invirt-console
+    {
+        for i in $(invirt-getconf --ls hosts); do
+            local hostname=$(invirt-getconf hosts.$i.hostname)
+            echo "#include /etc/conserver/conf.d/$hostname"
+        done
+    } > /etc/conserver/invirt-hosts.cf
+    local realm=$(invirt-getconf authn.0.realm)
+    {
+        for i in $(invirt-getconf --ls hosts); do
+            local hostname=$(invirt-getconf hosts.$i.hostname)
+            echo "host/$hostname@$realm"
+        done
+    } > /etc/remctl/acl/invirt-console
+
+    cat > /etc/nss-pgsql.conf << EOF
+host		= $(invirt-getconf db.host)
+port		= $(invirt-getconf db.port)
+database	= $(invirt-getconf db.dbname)
+login		= $(invirt-getconf db.user)
+
+querypasswd = SELECT name, NULL, machine_id + 1000 as uid, machine_id + 1000 as gid, '', '/consolefs/'|| name, '/usr/bin/sipb-xen-consolesh' FROM machines
+querygroup = SELECT name, NULL, machine_id + 1000 as gid FROM machines
+querymembers = SELECT name FROM machines WHERE 1000 + machine_id = %d
+queryids = SELECT 1000 + machine_id AS gid FROM machines LIMIT 0
+
+passwd_name = name
+passwd_uid = 1000 + machine_id
+
+group_name = name
+group_gid = 1000 + machine_id
+EOF
 }
 
Index: trunk/packages/sipb-xen-console/files/etc/nss-pgsql.conf
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/nss-pgsql.conf	(revision 842)
+++ 	(revision )
@@ -1,18 +1,0 @@
-# example configfile for PostgreSQL NSS module
-
-# these are entries as used with the BOFHMS tool (sf.net/projects/bofhms)
-host		= sipb-xen-dev
-port		= 5432
-database	= sipb_xen
-login		= sipb-xen
-
-querypasswd = SELECT name, NULL, machine_id + 1000 as uid, machine_id + 1000 as gid, '', '/consolefs/'|| name, '/usr/bin/sipb-xen-consolesh' FROM machines
-querygroup = SELECT name, NULL, machine_id + 1000 as gid FROM machines
-querymembers = SELECT name FROM machines WHERE 1000 + machine_id = %d
-queryids = SELECT 1000 + machine_id AS gid FROM machines LIMIT 0
-
-passwd_name = name
-passwd_uid = 1000 + machine_id
-
-group_name = name
-group_gid = 1000 + machine_id
