Commit 631ea01b authored by bourgesl's avatar bourgesl
Browse files

check FS write before starting web server

parent 496711ec
Pipeline #59574 skipped with stage
......@@ -6,6 +6,8 @@
# Check if service is running:
PID=`ps -ef | grep "${processId}" | grep -v "grep" | awk '{print $2}'`
......@@ -19,18 +21,28 @@ then
exit 1
# Move log before starting new process
mv ${logFile} ${logFile}.$(date +"%F_%T")
mv ${vmFile} ${vmFile}.$(date +"%F_%T")
# Test FS (write) before starting web server:
set -eux
echo "TEST production" > ${fsTestFile}
rm ${fsTestFile}
echo "Start vmstat in background..."
vmstat -t 60 2>&1 > ${vmFile} &
# Upgrade the database structure
CMD="obsportal-cli database upgrade --settings=client.ini"
echo "Running: $CMD"
# Launch the server
echo "Run 'pserve' $1"
exec pserve $1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment