X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-console.git/blobdiff_plain/2f01344744a9c2795e6171b53f1be8254f27cec5..1837357df009ee685385458db31828a972c9fffb:/debian/sipb-xen-console.init diff --git a/debian/sipb-xen-console.init b/debian/sipb-xen-console.init index 23d439d..b472606 100755 --- a/debian/sipb-xen-console.init +++ b/debian/sipb-xen-console.init @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/bash ### BEGIN INIT INFO # Provides: sipb-xen-console # Required-Start: $local_fs $remote_fs @@ -37,11 +37,37 @@ SCRIPTNAME=/etc/init.d/$NAME gen_config() { - perl -pe 's|^|#include /etc/conserver/conf.d/|' \ - /etc/conserver/invirt-hosts.cf - INVIRT_REALM="$(cat /etc/invirt/realm)" - perl -pe "s|^|host/|; s|\$|\@$INVIRT_REALM|" \ - /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 } #