Skip to content

Commit

Permalink
[dist] setup-appliance.sh - check if already started
Browse files Browse the repository at this point in the history
  • Loading branch information
M0ses committed Jul 5, 2021
1 parent 0bce674 commit 34bc8a0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion dist/setup-appliance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ ENABLE_OPTIONAL_SERVICES=0
ENABLE_FORCEPROJECTKEYS=1
MYSQL_USER=root
MYSQL_PASS=opensuse
PID_FILE=/run/setup-appliance.pid

# package or appliance defaults
if [ -e /etc/sysconfig/obs-server ]; then
Expand All @@ -709,9 +710,23 @@ fi


if [[ ! $BOOTSTRAP_TEST_MODE == 1 && $0 != "-bash" ]];then

logline "Starting "`basename $0`" at "`date`
NON_INTERACTIVE=0

if [ -f $PID_FILE ];then
APID=`cat $PID_FILE`
if [ ! -f /proc/$APID/status ];then
logline `basename $0`" died unexpectedly"
else
logline `basename $0`" already running. Exiting!"
exit 0
fi
fi

echo $$ > $PID_FILE

trap "rm -f $PID_FILE" EXIT

while [[ $1 ]];do
case $1 in
--non-interactive) NON_INTERACTIVE=1;;
Expand Down

0 comments on commit 34bc8a0

Please sign in to comment.