Remove DEFAULT_STACK_USER, just use STACK_USER
STACK_USER needs to be set for more than just stack.sh, there
was no real distinction for using DEFAULT_STACK_USER instead
of just setting STACK_USER directly in stackrc and allowing it
to be overridden in localrc.
Change-Id: I9e8d70db29bb421f1ce3dbf40a5ad299cc7ea785
diff --git a/tools/build_ramdisk.sh b/tools/build_ramdisk.sh
index cfcca51..2c45568 100755
--- a/tools/build_ramdisk.sh
+++ b/tools/build_ramdisk.sh
@@ -125,17 +125,17 @@
# Create a stack user that is a member of the libvirtd group so that stack
# is able to interact with libvirt.
chroot $MNTDIR groupadd libvirtd
- chroot $MNTDIR useradd $DEFAULT_STACK_USER -s /bin/bash -d $DEST -G libvirtd
+ chroot $MNTDIR useradd $STACK_USER -s /bin/bash -d $DEST -G libvirtd
mkdir -p $MNTDIR/$DEST
- chroot $MNTDIR chown $DEFAULT_STACK_USER $DEST
+ chroot $MNTDIR chown $STACK_USER $DEST
# A simple password - pass
- echo $DEFAULT_STACK_USER:pass | chroot $MNTDIR chpasswd
+ echo $STACK_USER:pass | chroot $MNTDIR chpasswd
echo root:$ROOT_PASSWORD | chroot $MNTDIR chpasswd
# And has sudo ability (in the future this should be limited to only what
# stack requires)
- echo "$DEFAULT_STACK_USER ALL=(ALL) NOPASSWD: ALL" >> $MNTDIR/etc/sudoers
+ echo "$STACK_USER ALL=(ALL) NOPASSWD: ALL" >> $MNTDIR/etc/sudoers
umount $MNTDIR
rmdir $MNTDIR
@@ -187,7 +187,7 @@
# Use this version of devstack
rm -rf $MNTDIR/$DEST/devstack
cp -pr $CWD $MNTDIR/$DEST/devstack
-chroot $MNTDIR chown -R $DEFAULT_STACK_USER $DEST/devstack
+chroot $MNTDIR chown -R $STACK_USER $DEST/devstack
# Configure host network for DHCP
mkdir -p $MNTDIR/etc/network
@@ -225,7 +225,7 @@
# Make the run.sh executable
chmod 755 $RUN_SH
-chroot $MNTDIR chown $DEFAULT_STACK_USER $DEST/run.sh
+chroot $MNTDIR chown $STACK_USER $DEST/run.sh
umount $MNTDIR
rmdir $MNTDIR
diff --git a/tools/build_uec.sh b/tools/build_uec.sh
index 5748b39..6c4a26c 100755
--- a/tools/build_uec.sh
+++ b/tools/build_uec.sh
@@ -207,11 +207,11 @@
`cat $TOP_DIR/localrc`
LOCAL_EOF
fi
-useradd -U -G sudo -s /bin/bash -d /opt/stack -m $DEFAULT_STACK_USER
-echo $DEFAULT_STACK_USER:pass | chpasswd
+useradd -U -G sudo -s /bin/bash -d /opt/stack -m $STACK_USER
+echo $STACK_USER:pass | chpasswd
mkdir -p /opt/stack/.ssh
echo "$PUB_KEY" > /opt/stack/.ssh/authorized_keys
-chown -R $DEFAULT_STACK_USER /opt/stack
+chown -R $STACK_USER /opt/stack
chmod 700 /opt/stack/.ssh
chmod 600 /opt/stack/.ssh/authorized_keys
@@ -224,7 +224,7 @@
# Run stack.sh
cat >> $vm_dir/uec/user-data<<EOF
-sudo -u $DEFAULT_STACK_USER bash -l -c "cd /opt/stack/devstack && ./stack.sh"
+sudo -u $STACK_USER bash -l -c "cd /opt/stack/devstack && ./stack.sh"
EOF
# (re)start a metadata service
diff --git a/tools/copy_dev_environment_to_uec.sh b/tools/copy_dev_environment_to_uec.sh
index add4ff6..3fd4423 100755
--- a/tools/copy_dev_environment_to_uec.sh
+++ b/tools/copy_dev_environment_to_uec.sh
@@ -46,13 +46,13 @@
# Create a stack user that is a member of the libvirtd group so that stack
# is able to interact with libvirt.
chroot $STAGING_DIR groupadd libvirtd || true
-chroot $STAGING_DIR useradd $DEFAULT_STACK_USER -s /bin/bash -d $DEST -G libvirtd || true
+chroot $STAGING_DIR useradd $STACK_USER -s /bin/bash -d $DEST -G libvirtd || true
# Add a simple password - pass
-echo $DEFAULT_STACK_USER:pass | chroot $STAGING_DIR chpasswd
+echo $STACK_USER:pass | chroot $STAGING_DIR chpasswd
# Configure sudo
-( umask 226 && echo "$DEFAULT_STACK_USER ALL=(ALL) NOPASSWD:ALL" \
+( umask 226 && echo "$STACK_USER ALL=(ALL) NOPASSWD:ALL" \
> $STAGING_DIR/etc/sudoers.d/50_stack_sh )
# Copy over your ssh keys and env if desired
@@ -67,7 +67,7 @@
cp_it . $STAGING_DIR/$DEST/devstack
# Give stack ownership over $DEST so it may do the work needed
-chroot $STAGING_DIR chown -R $DEFAULT_STACK_USER $DEST
+chroot $STAGING_DIR chown -R $STACK_USER $DEST
# Unmount
umount $STAGING_DIR
diff --git a/tools/xen/build_xva.sh b/tools/xen/build_xva.sh
index f3f166f..0e874cf 100755
--- a/tools/xen/build_xva.sh
+++ b/tools/xen/build_xva.sh
@@ -65,8 +65,8 @@
cat <<EOF >$STAGING_DIR/etc/rc.local
# network restart required for getting the right gateway
/etc/init.d/networking restart
-chown -R $DEFAULT_STACK_USER /opt/stack
-su -c "/opt/stack/run.sh > /opt/stack/run.sh.log" $DEFAULT_STACK_USER
+chown -R $STACK_USER /opt/stack
+su -c "/opt/stack/run.sh > /opt/stack/run.sh.log" $STACK_USER
exit 0
EOF