From 4d6cb14acc0175d8a45bd45cca4757846c066b85 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Mon, 12 Sep 2011 23:48:30 -0700 Subject: [PATCH] running as a regular user works --- apts/preseed | 6 ++++++ build_nfs.sh | 10 ++++++++-- stack.sh | 16 +++++++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/apts/preseed b/apts/preseed index d64c3b0..8712d5d 100644 --- a/apts/preseed +++ b/apts/preseed @@ -10,3 +10,9 @@ erlang-ssl 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 @@ fi # 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 @@ cd $DASH_DIR/openstack-dashboard; sudo python setup.py develop # 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 @@ mkdir -p $NOVA_DIR/instances # 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 @@ $NOVA_DIR/bin/nova-manage db sync # 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 @@ $NOVA_DIR/bin/nova-manage floating create $FLOATING_RANGE # 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 @@ function screen_it { 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 ----