running as a regular user works
diff --git a/apts/preseed b/apts/preseed
index d64c3b0..8712d5d 100644
--- a/apts/preseed
+++ b/apts/preseed
@@ -10,3 +10,9 @@
erlang-nox
erlang-inets
erlang-mnesia
+libhtml-template-perl
+gettext-base
+libavahi-client3
+libxml2-utils
+libpciaccess0
+libparted0debian1
diff --git a/build_nfs.sh b/build_nfs.sh
index fbfecfc..6509011 100755
--- a/build_nfs.sh
+++ b/build_nfs.sh
@@ -53,9 +53,15 @@
# set root password to password
echo root:pass | chroot $DEST chpasswd
-# create a stack user
-chroot $DEST useradd stack -s /bin/bash -d /opt
+# Create a stack user that is a member of the libvirtd group so that stack
+# is able to interact with libvirt.
+chroot $DEST groupadd libvirtd
+chroot $DEST useradd stack -s /bin/bash -d /opt -G libvirtd
+# a simple password - pass
echo stack:pass | chroot $DEST chpasswd
+# give stack ownership over /opt so it may do the work needed
chroot $DEST chown -R stack /opt
+# and has sudo ability (in the future this should be limited to only what
+# stack requires)
echo "stack ALL=(ALL) NOPASSWD: ALL" >> $DEST/etc/sudoers
diff --git a/stack.sh b/stack.sh
index 906755b..730dc5c 100755
--- a/stack.sh
+++ b/stack.sh
@@ -92,6 +92,8 @@
# device - used to manage qcow images)
sudo modprobe nbd || true
sudo modprobe kvm || true
+# user needs to be member of libvirtd group for nova-compute to use libvirt
+sudo usermod -a -G libvirtd `whoami`
# if kvm wasn't running before we need to restart libvirt to enable it
sudo /etc/init.d/libvirt-bin restart
@@ -105,6 +107,7 @@
# FIXME: if already mounted this blows up...
if [ -L /dev/disk/by-label/nova-instances ]; then
sudo mount -L nova-instances $NOVA_DIR/instances
+ sudo chown -R `whoami` $NOVA_DIR/instances
fi
# *Dashboard*: setup django application to serve via apache/wsgi
@@ -187,6 +190,8 @@
# initialize keystone with default users/endpoints
rm -f /opt/keystone/keystone.db
+# FIXME keystone creates a keystone.log wherever you run it from (bugify)
+cd /tmp
BIN_DIR=$KEYSTONE_DIR/bin bash $DIR/files/keystone_data.sh
# create a small network
@@ -197,7 +202,10 @@
# delete existing glance images/database. Glance will recreate the db
# when it is ran.
-#rm -rf /var/lib/glance/images/*
+# FIXME: configure glance not to shove files in /var/lib/glance?
+sudo mkdir -p /var/lib/glance
+sudo chown -R `whoami` /var/lib/glance
+rm -rf /var/lib/glance/images/*
rm -f $GLANCE_DIR/glance.sqlite
# nova api crashes if we start it with a regular screen command,
@@ -209,13 +217,15 @@
screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf"
screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf"
-screen_it key "$KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_DIR/etc/keystone.conf"
+# keystone drops a keystone.log where if it is run, so change the path to
+# where it can write
+screen_it key "cd /tmp; $KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_DIR/etc/keystone.conf"
screen_it n-api "$NOVA_DIR/bin/nova-api"
screen_it n-cpu "$NOVA_DIR/bin/nova-compute"
screen_it n-net "$NOVA_DIR/bin/nova-network"
screen_it n-sch "$NOVA_DIR/bin/nova-scheduler"
screen_it n-vnc "$NOVA_DIR/bin/nova-vncproxy"
-screen_it dash "/etc/init.d/apache2 restart; tail -f /var/log/apache2/error.log"
+screen_it dash "sudo /etc/init.d/apache2 restart; tail -f /var/log/apache2/error.log"
# ---- download an install images ----