From e7dd9e9bfd2cab3088bd7fbdc33f70f61e86b3bd Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Sat, 11 Aug 2018 14:24:07 -0400 Subject: [PATCH] bootstrap: fix a few more bootstrap bugs domtool user creation is actually optional for development/testing builds ensure build-tree versions of programs are used when bootstrapping to avoid need to install. should be possible to run without installing now. --- bootstrap/bootstrap | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap index b3a6a4f..db6750c 100755 --- a/bootstrap/bootstrap +++ b/bootstrap/bootstrap @@ -3,8 +3,23 @@ # Bootstrap everything for a DEVELOPMENT ENVIRONMENT (an insecure one # at that), assuming you are going to be domtool root +# prepend build tree versions of domtool programs for bootstrapping +BOOTSTRAP_PATH=../bin:../scripts:$PATH + +create_user="$1" + if [ -z "`getent passwd domtool`" ]; then - adduser --disabled-password domtool + if [ "$create_user" = "-create-user" ]; then + echo "creating domtool user..." + adduser --disabled-password domtool || (echo "failed!" ; exit 1) + else if [ "$create_user" = "-skip-create-user" ]; then + echo "skipping domtool user creation" + else + echo "domtool user does not exist. To create, run $0 -create-user, to skip run $0 -skip-create-user" + exit 1 + fi + fi + fi ./domtool-create-shared-root @@ -12,11 +27,14 @@ fi ./domtool-create-ca -force ./domtool-init-truststore ./domtool-init-acl `whoami` -domtool-addcert `uname -n` -unsafe +PATH=$BOOTSTRAP_PATH ../scripts/domtool-addcert `uname -n` -unsafe -/usr/local/sbin/domtool-server & +PATH=$BOOTSTRAP_PATH ../bin/domtool-server & SERVER_PID=$! -domtool-adduser `whoami` -unsafe +echo "waiting five seconds for domtool to coalesce" +sleep 5 # give domtool a chance to start + +PATH=$BOOTSTRAP_PATH ../scripts/domtool-adduser `whoami` -unsafe kill $SERVER_PID -- 2.20.1