From 2995d8728b6a6f74ace741db996cc7699b3c4801 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Wed, 13 Aug 2008 02:05:31 -0400 Subject: [PATCH] using mako-render to generate nss-pgsql.conf from gen_config svn path=/trunk/packages/sipb-xen-console/; revision=887 --- debian/sipb-xen-console.init | 18 +----------------- files/etc/nss-pgsql.conf.mako | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 files/etc/nss-pgsql.conf.mako diff --git a/debian/sipb-xen-console.init b/debian/sipb-xen-console.init index 435aaf3..3986a84 100755 --- a/debian/sipb-xen-console.init +++ b/debian/sipb-xen-console.init @@ -51,23 +51,7 @@ gen_config() 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 + mako-render /etc/nss-pgsql.conf.mako > /etc/nss-pgsql.conf fmt > /etc/issue.net.no_tkt << EOF You must login to the $(invirt-getconf console.hostname) console server using diff --git a/files/etc/nss-pgsql.conf.mako b/files/etc/nss-pgsql.conf.mako new file mode 100644 index 0000000..e1aa001 --- /dev/null +++ b/files/etc/nss-pgsql.conf.mako @@ -0,0 +1,16 @@ +<% from invirt.config import structs as cfg %> +host = ${cfg.db.host} +port = ${cfg.db.port} +database = ${cfg.db.dbname} +login = ${cfg.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 -- 1.7.9.5