Commit 2db60f5b authored by Boxiang Sun's avatar Boxiang Sun

peertube: restore fixup

parent 58db1a98
Pipeline #25029 passed with stage
in 0 seconds
......@@ -54,4 +54,4 @@ md5sum = 58d1a4fe246169dea94d7d243b4bac9e
[template-peertube-restore-script]
filename = template-peertube-restore.sh.in
md5sum = 8e6091bc739f44801f52b004fac136d9
md5sum = 5b9eea04afd548cfcb1e1a64b97a4f66
......@@ -46,9 +46,20 @@ else
$${postgresql:bin}/postgres -D $${postgresql:pgdata-directory} &
postgres_pid=$!
echo $postgres_pid
echo "Anyway, the postgresql is running..."
fi
echo "Anyway, the postgresql is running..."
if ! [ -e "$pid_file" ]; then
echo "postgresql exited..."
fi
tpgwait=60
while ! [ -e "$pid_file" ]; do
tpgwait=$(( $tpgwait - 1 ))
test $tpgwait = 0 && die "pid_file not exist"
echo "pid_file not exist; will retry $tpgwait times..." 1>&2
sleep 1
done
# run psql
psql() {
......@@ -75,8 +86,9 @@ echo "Ready to check postgresql is running..."
# sleep 5
echo "Check postgresql is running again"
# Check the postgresql is running, if postgresql has stopped, abort
pid_file=$${postgresql:pgdata-directory}/postmaster.pid
if ! [ -e "$pid_file" ]; then
echo "postgresql exited, aborting."
exit 1
......
Markdown is supported
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