Commit 5547a758 authored by Boxiang Sun's avatar Boxiang Sun

peertube: fixup

parent 13fdef74
Pipeline #25208 passed with stage
in 0 seconds
...@@ -18,7 +18,7 @@ md5sum = 35690065ba18dc49d0108fc1f0a07b9e ...@@ -18,7 +18,7 @@ md5sum = 35690065ba18dc49d0108fc1f0a07b9e
[instance-peertube] [instance-peertube]
_update_hash_filename_ = instance-peertube.cfg.in _update_hash_filename_ = instance-peertube.cfg.in
md5sum = db076bb9b8e5392ec560b15236c8f1d0 md5sum = 053edcc9d593dfb869be9fe4b1850b3f
[template-nginx-service] [template-nginx-service]
filename = template-nginx-service.sh.in filename = template-nginx-service.sh.in
...@@ -54,4 +54,4 @@ md5sum = e50daa16a2c1866997933981bed45271 ...@@ -54,4 +54,4 @@ md5sum = e50daa16a2c1866997933981bed45271
[template-peertube-restore-script] [template-peertube-restore-script]
filename = template-peertube-restore.sh.in filename = template-peertube-restore.sh.in
md5sum = b4f2460cb1acb256b32442034aec1cfd md5sum = b8508e3eef74f1903e328b52bc5ddc03
...@@ -124,9 +124,7 @@ config-file = ${directory:etc}/redis.conf ...@@ -124,9 +124,7 @@ config-file = ${directory:etc}/redis.conf
log-file = ${redis:log}/redis.log log-file = ${redis:log}/redis.log
pid-file = ${directory:run}/redis.pid pid-file = ${directory:run}/redis.pid
use-passwd = false use-passwd = false
# If we want to run the peertube test locally, the length of the socket path unixsocket = ${:server-dir}/redis.socket
# should not too long
unixsocket = ${directory:var}/r.socket
# port = 0 means "don't listen on TCP at all" - listen only on unix socket # port = 0 means "don't listen on TCP at all" - listen only on unix socket
ipv6 = ::1 ipv6 = ::1
port = 0 port = 0
......
...@@ -15,17 +15,6 @@ die() { ...@@ -15,17 +15,6 @@ die() {
exit 1 exit 1
} }
pg_version=$${postgresql:pgdata-directory}/PG_VERSION
echo "Check postgresql data directory is ready"
tpgwait=60
while ! [ -e "$pg_version" ]; do
tpgwait=$(( $tpgwait - 1 ))
test $tpgwait = 0 && die "PGdata directory not ready"
echo "I: PGdata directory is not ready (yet ?); will retry $tpgwait times..." 1>&2
sleep 1
done
echo "Postgresql data directory is ready" echo "Postgresql data directory is ready"
# 2. Make sure the postgresql process is not running. # 2. Make sure the postgresql process is not running.
# Quote from the postgresql doc: # Quote from the postgresql doc:
...@@ -39,18 +28,11 @@ if [ -e "$pid_file" ]; then ...@@ -39,18 +28,11 @@ if [ -e "$pid_file" ]; then
fi fi
echo "Starting postgresql..." echo "Starting postgresql..."
$${postgresql:bin}/postgres -D $${postgresql:pgdata-directory} -h $${postgresql:ipv4} -p $${postgresql:port} & # $${postgresql:bin}/postgres -D $${postgresql:pgdata-directory} -h $${postgresql:ipv4} -p $${postgresql:port} &
$${postgresql:bin}/postgres -D $${postgresql:pgdata-directory} &
postgresql_pid=$! postgresql_pid=$!
trap "kill $postgresql_pid" EXIT TERM INT trap "kill $postgresql_pid" EXIT TERM INT
pgwait=60
while ! [ -e "$pid_file" ]; do
tpgwait=$(( $tpgwait - 1 ))
test $tpgwait = 0 && die "Can not create pid_file"
echo "pid_file not exist; will retry $tpgwait times..." 1>&2
sleep 1
done
# If postgres has stopped, abort # If postgres has stopped, abort
if ! [ -d /proc/$postgresql_pid ]; then if ! [ -d /proc/$postgresql_pid ]; then
echo "postgresql exited, aborting." echo "postgresql exited, aborting."
...@@ -81,16 +63,6 @@ while true; do ...@@ -81,16 +63,6 @@ while true; do
done done
echo "I: PostgreSQL ready." 1>&2 echo "I: PostgreSQL ready." 1>&2
# sleep 5
echo "Check postgresql is running again"
# Check the postgresql is running, if postgresql has stopped, abort
if ! [ -e "$pid_file" ]; then
echo "postgresql exited, aborting."
exit 1
fi
echo "Postgresql is running, ready to restore" echo "Postgresql is running, ready to restore"
# Restore the database # Restore the database
......
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