Skip to content

Commit 7fb7acf

Browse files
committed
Set init stop timeout to 10 min
`bitcoind` can take a long time to flush its db cache to disk upon shutdown. Most init files send a `SIGKILL` after a timeout of 1 minute, causing unclean shutdowns and triggering a long "Rolling forward" at the next startup. Increasing this timeout to 10 minutes should reduce how often this occurs, especially during IBD. fixup! Set ProtectHome in systemd service file
1 parent fbe4b76 commit 7fb7acf

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
@@ -24,6 +24,7 @@ ExecStart=/usr/bin/bitcoind -daemon \
2424
Type=forking
2525
PIDFile=/run/bitcoind/bitcoind.pid
2626
Restart=on-failure
27+
TimeoutStopSec=600
2728

2829
# Directory creation and permissions
2930
####################################

0 commit comments

Comments
 (0)