Skip to content

Commit

Permalink
Set init stop timeout to 10 min
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
setpill committed Sep 6, 2019
1 parent fbe4b76 commit 7fb7acf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contrib/init/bitcoind.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ expect fork

respawn
respawn limit 5 120
kill timeout 60
kill timeout 600

pre-start script
# this will catch non-existent config files
Expand Down
2 changes: 1 addition & 1 deletion contrib/init/bitcoind.init
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ start() {

stop() {
echo -n $"Stopping $prog: "
killproc $prog
killproc $prog -t600
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
Expand Down
2 changes: 1 addition & 1 deletion contrib/init/bitcoind.openrcconf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
# Note that this will be mapped as argument to start-stop-daemon's
# '--retry' option, which means you can specify a retry schedule
# here. For more information see man 8 start-stop-daemon.
BITCOIND_SIGTERM_TIMEOUT=60
BITCOIND_SIGTERM_TIMEOUT=600
1 change: 1 addition & 0 deletions contrib/init/bitcoind.service
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ExecStart=/usr/bin/bitcoind -daemon \
Type=forking
PIDFile=/run/bitcoind/bitcoind.pid
Restart=on-failure
TimeoutStopSec=600

# Directory creation and permissions
####################################
Expand Down

0 comments on commit 7fb7acf

Please sign in to comment.