aboutsummaryrefslogtreecommitdiffstats
path: root/vespabase/src/rhel-prestart.sh
diff options
context:
space:
mode:
authorArne Juul <arnej@yahooinc.com>2022-10-24 10:02:58 +0000
committerArne Juul <arnej@yahooinc.com>2022-10-24 10:02:58 +0000
commit1417a48bd4aecfb5e182d6c7b81960e3d7232309 (patch)
tree256cff43ab30ea2c5efbe31c9d1ad7eb316eefea /vespabase/src/rhel-prestart.sh
parentfa29e75a71b49fc3925349457bb43de03b6d60d8 (diff)
* apply new common bootstrap
* remove now-duplicated code * prefer using ${VESPA_HOME} environment variable
Diffstat (limited to 'vespabase/src/rhel-prestart.sh')
-rwxr-xr-xvespabase/src/rhel-prestart.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/vespabase/src/rhel-prestart.sh b/vespabase/src/rhel-prestart.sh
index 0aedfb4622d..c7906342161 100755
--- a/vespabase/src/rhel-prestart.sh
+++ b/vespabase/src/rhel-prestart.sh
@@ -72,6 +72,9 @@ findhost () {
findroot
findhost
+ROOT=${VESPA_HOME%/}
+export ROOT
+
# END environment bootstrap section
[ "$VESPA_HOME" ] || { echo "Missing VESPA_HOME variable" 1>&2; exit 1; }
@@ -87,7 +90,7 @@ if [ "$VESPA_GROUP" = "" ]; then
fi
IS_ROOT=$([ "$(id -ru)" == "0" ] && echo true || echo false)
-cd $VESPA_HOME || { echo "Cannot cd to $VESPA_HOME" 1>&2; exit 1; }
+cd ${VESPA_HOME} || { echo "Cannot cd to ${VESPA_HOME}" 1>&2; exit 1; }
fixdir () {
if [ $# != 4 ]; then
@@ -100,11 +103,11 @@ fixdir () {
local user=${stat% *}
local group=${stat#* }
if [ "$1" != "$user" ]; then
- echo "Wrong owner for $VESPA_HOME/$4, expected $1, was $user"
+ echo "Wrong owner for ${VESPA_HOME}/$4, expected $1, was $user"
exit 1
fi
if [ "$2" != "$group" ]; then
- echo "Wrong group for $VESPA_HOME/$4, expected $2, was $group"
+ echo "Wrong group for ${VESPA_HOME}/$4, expected $2, was $group"
exit 1
fi
else