Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos
Commits
16a8c954
Commit
16a8c954
authored
Nov 28, 2022
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peertube: restore fixup
parent
8cce20be
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
software/peertube/buildout.hash.cfg
software/peertube/buildout.hash.cfg
+1
-1
software/peertube/template-peertube-restore.sh.in
software/peertube/template-peertube-restore.sh.in
+24
-21
software/theia/test/project_tests.py
software/theia/test/project_tests.py
+5
-1
No files found.
software/peertube/buildout.hash.cfg
View file @
16a8c954
...
@@ -54,4 +54,4 @@ md5sum = 58d1a4fe246169dea94d7d243b4bac9e
...
@@ -54,4 +54,4 @@ md5sum = 58d1a4fe246169dea94d7d243b4bac9e
[template-peertube-restore-script]
[template-peertube-restore-script]
filename = template-peertube-restore.sh.in
filename = template-peertube-restore.sh.in
md5sum =
05c1fb674758ea66f8509d0710c89b28
md5sum =
fb7b8ebb4724495a7d17ab93c8464515
software/peertube/template-peertube-restore.sh.in
View file @
16a8c954
...
@@ -40,25 +40,20 @@ echo "Postgresql data directory is ready"
...
@@ -40,25 +40,20 @@ echo "Postgresql data directory is ready"
# which means if the postmaster.pid exist, then the postgresql is running.
# which means if the postmaster.pid exist, then the postgresql is running.
pid_file=$${postgresql:pgdata-directory}/postmaster.pid
pid_file=$${postgresql:pgdata-directory}/postmaster.pid
if [ -e "$pid_file" ]; then
if [ -e "$pid_file" ]; then
echo "
p
ostgresql is running, continue."
echo "
P
ostgresql is running, continue."
else
else
echo "Stop postgresql service"
$${postgresql:bin}/pg_ctl -D $${postgresql:pgdata-directory} stop
wait
echo "Starting postgresql..."
echo "Starting postgresql..."
echo ls $${postgresql:pgdata-directory}
$${postgresql:bin}/postgres -D $${postgresql:pgdata-directory}
$${postgresql:bin}/postgres -D $${postgresql:pgdata-directory} &
wait
# postgres_pid=$!
# echo $postgres_pid
# wait $postgres_pid
echo "Anyway, the postgresql is running..."
fi
if ! [ -e "$pid_file" ]; then
echo "postgresql exited..."
fi
fi
tpgwait=60
tpgwait=60
while ! [ -e "$pid_file" ]; do
while ! [ -e "$pid_file" ]; do
tpgwait=$(( $tpgwait - 1 ))
tpgwait=$(( $tpgwait - 1 ))
test $tpgwait = 0 && die "
pid_file not exist
"
test $tpgwait = 0 && die "
Can not create pid_file
"
echo "pid_file not exist; will retry $tpgwait times..." 1>&2
echo "pid_file not exist; will retry $tpgwait times..." 1>&2
sleep 1
sleep 1
done
done
...
@@ -76,15 +71,15 @@ echo "Ready to check postgresql is running..."
...
@@ -76,15 +71,15 @@ echo "Ready to check postgresql is running..."
# initial db setup
# initial db setup
# ( first quering PG several times waiting a bit till postgresql is started and ready )
# ( first quering PG several times waiting a bit till postgresql is started and ready )
# tpgwait=5
tpgwait=10
#
while true; do
while true; do
#
pgtables="$(psql -c '\d' 2>&1)" && break
pgtables="$(psql -c '\d' 2>&1)" && break
#
tpgwait=$(( $tpgwait - 1 ))
tpgwait=$(( $tpgwait - 1 ))
#
test $tpgwait = 0 && die "pg query problem"
test $tpgwait = 0 && die "pg query problem"
#
echo "I: PostgreSQL is not ready (yet ?); will retry $tpgwait times..." 1>&2
echo "I: PostgreSQL is not ready (yet ?); will retry $tpgwait times..." 1>&2
#
sleep 1
sleep 1
#
done
done
#
echo "I: PostgreSQL ready." 1>&2
echo "I: PostgreSQL ready." 1>&2
# sleep 5
# sleep 5
...
@@ -115,4 +110,12 @@ if [ -e "$pid_file" ]; then
...
@@ -115,4 +110,12 @@ if [ -e "$pid_file" ]; then
pkill -9 -f "$${postgresql:bin}/postgres -D $${postgresql:pgdata-directory}"
pkill -9 -f "$${postgresql:bin}/postgres -D $${postgresql:pgdata-directory}"
fi
fi
tpgwait=60
while [ -e "$pid_file" ]; do
tpgwait=$(( $tpgwait - 1 ))
test $tpgwait = 0 && die "Pid file always exist"
echo "I: Pid file still exist; will retry $tpgwait times..." 1>&2
sleep 1
done
echo "Postgresql process killed"
echo "Postgresql process killed"
software/theia/test/project_tests.py
View file @
16a8c954
...
@@ -337,7 +337,7 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
...
@@ -337,7 +337,7 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
# Compute backup date in the near future
# Compute backup date in the near future
soon
=
(
datetime
.
now
()
+
timedelta
(
minutes
=
4
)).
replace
(
second
=
0
)
soon
=
(
datetime
.
now
()
+
timedelta
(
minutes
=
4
)).
replace
(
second
=
0
)
frequency
=
'%d * * * *'
%
soon
.
minute
frequency
=
'%d * * * *'
%
soon
.
minute
params
=
'
_={"frequency": "%s"}
'
%
frequency
params
=
'
"frequency"="%s"
'
%
frequency
# Update Peertube parameters
# Update Peertube parameters
print
(
'Requesting Peertube with parameters %s'
%
params
)
print
(
'Requesting Peertube with parameters %s'
%
params
)
...
@@ -367,6 +367,10 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
...
@@ -367,6 +367,10 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
postgres_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'postgres'
)
postgres_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'postgres'
)
postgresql_srv
=
os
.
path
.
join
(
postgresql_partition
,
'srv'
,
'postgresql'
)
postgresql_srv
=
os
.
path
.
join
(
postgresql_partition
,
'srv'
,
'postgresql'
)
# Stop all services
print
(
"Stop all services"
)
self
.
callSlapos
(
'node'
,
'stop'
,
'all'
)
# Check that the test instance is properly redeployed after restoring postgresql
# Check that the test instance is properly redeployed after restoring postgresql
# This restarts the services and checks the promises of the test instance
# This restarts the services and checks the promises of the test instance
# Process twice to propagate state change
# Process twice to propagate state change
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment