Skip to content

Commit 99cebc9

Browse files
committed
Merge #16569: Increase init file stop timeout
7fb7acf Set init stop timeout to 10 min (setpill) Pull request description: `bitcoind` can take a long time to flush its db cache to disk upon shutdown. Systemd sends a `SIGKILL` after a timeout, causing unclean shutdowns and triggering a long "Rolling forward" at the next startup. Disabling the timeout should prevent this from happening, and does not break systemd's `restart` logic. Addresses #13736. ACKs for top commit: instagibbs: utACK bitcoin/bitcoin@7fb7acf Tree-SHA512: 16e0ce5a9ecf0628f8d93d68db3f5a78ab36021d9bede05a90c84f144db2e87e17707a6eb910cb7c018c265ce2c81d43de2988bd79e4a2d8554515db8fb5aa36
2 parents 34919e0 + 7fb7acf commit 99cebc9

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

contrib/init/bitcoind.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ expect fork
1616

1717
respawn
1818
respawn limit 5 120
19-
kill timeout 60
19+
kill timeout 600
2020

2121
pre-start script
2222
# this will catch non-existent config files

contrib/init/bitcoind.init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ start() {
3939

4040
stop() {
4141
echo -n $"Stopping $prog: "
42-
killproc $prog
42+
killproc $prog -t600
4343
RETVAL=$?
4444
echo
4545
[ $RETVAL -eq 0 ] && rm -f $lockfile

contrib/init/bitcoind.openrcconf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
# Note that this will be mapped as argument to start-stop-daemon's
3131
# '--retry' option, which means you can specify a retry schedule
3232
# here. For more information see man 8 start-stop-daemon.
33-
BITCOIND_SIGTERM_TIMEOUT=60
33+
BITCOIND_SIGTERM_TIMEOUT=600

contrib/init/bitcoind.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ExecStartPre=/bin/chgrp bitcoin /etc/bitcoin
2929
Type=forking
3030
PIDFile=/run/bitcoind/bitcoind.pid
3131
Restart=on-failure
32+
TimeoutStopSec=600
3233

3334
# Directory creation and permissions
3435
####################################

0 commit comments

Comments
 (0)