Skip to content

Commit fda606d

Browse files
nicbusshesek
authored andcommitted
fix docker service stop
1 parent dce54c3 commit fda606d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

contrib/runit_boot.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
shutdown() {
44
echo "shutting down the container"
55

6-
# first shutdown any service started by runit
6+
# first shut down socat (avoid "Iterrupted by signal 15" error)
7+
sv -w "$SVWAIT" force-stop socat
8+
9+
# next shut down electrs (avoid long wait + losing blocks in bitcoind)
10+
sv -w "$SVWAIT" force-stop electrs
11+
12+
# then shutdown any other service started by runit
713
for _srv in $(ls -1 /etc/service); do
8-
sv force-stop $_srv
14+
sv -w "$SVWAIT" force-stop "$_srv"
915
done
1016

1117
# shutdown runsvdir command
12-
kill -HUP $RUNSVDIR
13-
wait $RUNSVDIR
18+
kill -HUP "$RUNSVDIR"
19+
wait "$RUNSVDIR"
1420

1521
# give processes time to stop
1622
sleep 0.5
@@ -39,7 +45,7 @@ echo "wait for processes to start...."
3945

4046
sleep 5
4147
for _srv in $(ls -1 /etc/service); do
42-
sv status $_srv
48+
sv status "$_srv"
4349
done
4450

4551
# catch shutdown signals

0 commit comments

Comments
 (0)