Skip to content
Snippets Groups Projects
Commit e3c391c9 authored by brinn's avatar brinn
Browse files

change: check at server startup of DSS and AS that the user who tries to...

change: check at server startup of DSS and AS that the user who tries to startup the server is not root and exit otherwise

SVN: 22521
parent 825a5f0e
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,14 @@ isPIDRunning() ...@@ -42,6 +42,14 @@ isPIDRunning()
fi fi
} }
checkNotRoot()
{
if [ $UID -eq 0 ]; then
echo "openBIS Data Store Server cannot run as user 'root'." > /dev/stderr
exit 1
fi
}
rotateLogFiles() rotateLogFiles()
{ {
logfile=$1 logfile=$1
...@@ -143,6 +151,7 @@ CMD="${JAVA_BIN} ${JAVA_OPTS} -classpath $CP ch.systemsx.cisd.openbis.dss.generi ...@@ -143,6 +151,7 @@ CMD="${JAVA_BIN} ${JAVA_OPTS} -classpath $CP ch.systemsx.cisd.openbis.dss.generi
command="${command#--*}" command="${command#--*}"
case "$command" in case "$command" in
start) start)
checkNotRoot
getStatus getStatus
EXIT_STATUS=$? EXIT_STATUS=$?
if [ $EXIT_STATUS -eq 0 ]; then if [ $EXIT_STATUS -eq 0 ]; then
......
#! /bin/bash #! /bin/bash
if [ $UID -eq 0 ]; then
echo "openBIS Application Server cannot run as user 'root'." > /dev/stderr
exit 1
fi
source `dirname "$0"`/setup-env source `dirname "$0"`/setup-env
$JVM -DSTOP.PORT=$JETTY_STOP_PORT \ $JVM -DSTOP.PORT=$JETTY_STOP_PORT \
-DSTOP.KEY=$JETTY_STOP_KEY \ -DSTOP.KEY=$JETTY_STOP_KEY \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment