From 89cfd3b492d2b755c7d544e70c5089371ed68814 Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Thu, 29 Jan 2015 16:49:54 -0800 Subject: [PATCH 1/4] Issue #25: /opt/gemstone/log is default if GEMSTONE_LOGDIR not defined --- bin/startGemServerGem | 6 +++++- bin/stopGemServerGem | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/startGemServerGem b/bin/startGemServerGem index 06403c3..25d824d 100755 --- a/bin/startGemServerGem +++ b/bin/startGemServerGem @@ -43,7 +43,11 @@ else ExeArg="-e $3" fi -logFile="${GEMSTONE_LOGDIR}/${GemServer}_server-${Port}.log" +logDir=${GEMSTONE_LOGDIR} +if [ "${logDir}x" = "x" ] ; then + logDir=/opt/gemstone/log +fi +logFile="${logDir}/${GemServer}_server-${Port}.log" echo "Starting $GemServer on $Port exeConf: -$ExeConf- logFile: -$logFile-" diff --git a/bin/stopGemServerGem b/bin/stopGemServerGem index e27ab20..38b49cc 100755 --- a/bin/stopGemServerGem +++ b/bin/stopGemServerGem @@ -4,7 +4,12 @@ GemServer="$1" Port="$2" # must match GemServer>>gemPidFileName: -pidfile="${GEMSTONE_LOGDIR}/${GemServer}_server-${Port}.pid" + +logDir=${GEMSTONE_LOGDIR} +if [ "${logDir}x" = "x" ] ; then + logDir=/opt/gemstone/log +fi +pidfile="${logDir}/${GemServer}_server-${Port}.pid" if [ -e $pidfile ]; then pid=`cat $pidfile` From 5bf034932b8cd90cfb7af3491c053f20f3e8c4af Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Mon, 2 Feb 2015 10:22:33 -0800 Subject: [PATCH 2/4] Issue #27: use GEMSTONE_ETC_DIR if present ... default is GEMSTONE/seaside/etc/gemstone.secret as before --- bin/startGemServerGem | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/startGemServerGem b/bin/startGemServerGem index 25d824d..3d59f06 100755 --- a/bin/startGemServerGem +++ b/bin/startGemServerGem @@ -30,10 +30,15 @@ set -e # exit on error # # export GS_DEBUG_VMGC_PRINT_MKSW_MEMORY_USED=75 -if [ -s $GEMSTONE/seaside/etc/gemstone.secret ]; then - . $GEMSTONE/seaside/etc/gemstone.secret +secret=$GEMSTONE/seaside/etc/gemstone.secret +if [ "${GEMSTONE_ETC_DIR}x" = "x" ] ; then + secret=$GEMSTONE_ETC_DIR +fi + +if [ -s $secret ]; then + . $secret else - echo 'Missing password file $GEMSTONE/seaside/etc/gemstone.secret' + echo 'Missing password file $secret' exit 1 fi From 4c96185b5c8e1d35252b87631bd344a8cada6245 Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Mon, 2 Feb 2015 10:59:59 -0800 Subject: [PATCH 3/4] Issue #27: switch to using GEMSTONE_ETC_SECRET instead of GEMSTONE_ETC_DIRspecify name of file as well in env var --- bin/startGemServerGem | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/startGemServerGem b/bin/startGemServerGem index 3d59f06..9f41ef4 100755 --- a/bin/startGemServerGem +++ b/bin/startGemServerGem @@ -30,9 +30,9 @@ set -e # exit on error # # export GS_DEBUG_VMGC_PRINT_MKSW_MEMORY_USED=75 -secret=$GEMSTONE/seaside/etc/gemstone.secret -if [ "${GEMSTONE_ETC_DIR}x" = "x" ] ; then - secret=$GEMSTONE_ETC_DIR +secret=${GEMSTONE_ETC_SECRET} +if [ "${GEMSTONE_ETC_SECRET}x" = "x" ] ; then + secret=$GEMSTONE/seaside/etc/gemstone.secret fi if [ -s $secret ]; then From 11a422d399ecec982bdddebaeea76f86f120ef91 Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Mon, 2 Feb 2015 11:16:05 -0800 Subject: [PATCH 4/4] Issue #27: add GEMSTONE_USER_NAME as option for defined the gemstone user --- bin/startGemServerGem | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/startGemServerGem b/bin/startGemServerGem index 9f41ef4..9fc8540 100755 --- a/bin/startGemServerGem +++ b/bin/startGemServerGem @@ -54,11 +54,16 @@ if [ "${logDir}x" = "x" ] ; then fi logFile="${logDir}/${GemServer}_server-${Port}.log" +username=$GEMSTONE_USER_NAME +if [ "${GEMSTONE_USER_NAME}x" = "x" ] ; then + username=DataCurator +fi + echo "Starting $GemServer on $Port exeConf: -$ExeConf- logFile: -$logFile-" cat << EOF | nohup $GEMSTONE/bin/topaz -l ${ExeArg} >> $logFile 2>&1 & -set user DataCurator pass $GEMSTONE_CURATOR_PASS gems $GEMSTONE_NAME +set user $username pass $GEMSTONE_CURATOR_PASS gems $GEMSTONE_NAME display oops iferror stack