Commit graph

9 commits

Author SHA1 Message Date
Wladimir J. van der Laan 99cebc922c
Merge #16569: Increase init file stop timeout
7fb7acfc20 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 7fb7acfc20

Tree-SHA512: 16e0ce5a9ecf0628f8d93d68db3f5a78ab36021d9bede05a90c84f144db2e87e17707a6eb910cb7c018c265ce2c81d43de2988bd79e4a2d8554515db8fb5aa36
2019-10-08 11:38:44 +02:00
setpill 7fb7acfc20 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
2019-09-06 17:03:04 +02:00
setpill 870d4152df Set ProtectHome in systemd service file
Further hardening; the service should be run with as many restrictions
as possible without breaking it.
2019-08-20 10:54:14 +02:00
setpill 639a416e37 Chgrp config dir to bitcoin in systemd service
Rather than making the config dir world-readable, which potentially
leaks RPC credentials, the group of the directory is changed to the one
the service is executed as.
2019-08-20 10:54:14 +02:00
setpill aded0528f0 Improve clarity of systemd service file comments
The phrasing seemed to indicate that the options specified in
ExecStart= could not be specified in the config file, necessitating
their inclusion in the service file. However, the options in the
config file simply get overridden by any specified in ExecStart=.
2019-08-20 10:54:14 +02:00
Carl Dong b0c7b54d0c init: Use systemd automatic directory creation
Tell systemd to create, set, and ensure the right mode for the PID,
configuration, and data directories.

Only the exec bit is set for groups for the aforementioned directories.
This is the least privilege perm that allows for the
reading/writing/execing of files under the directory _if_ the files
themselves give permission to its group to do so (e.g. when -sysperms is
specified). Note that this does not allow for the listing of files under
the directory.
2019-01-05 13:21:44 +08:00
Florian Schmaus 79ddfad486 Apply hardening measurements in bitcoind systemd service file
Adds typical systemd hardening measurements for network services.
2018-03-14 08:11:07 +01:00
Florian Schmaus 16be7ddbaa Improve bitcoind systemd service file
Add comment how further options can be added or existing ones
modified. Use /run/${RuntimeDirectory} for PID file.

Remove TimeoutStopSec, TimeoutStartSec, StartLimitInterval,
StartLimitBurst directives as those should be set indivdually.

Remove Group to user the bitcoin user's default group.

Changed Restart from 'always' to 'on-failure' (can also be overwritten
individually).
2017-06-05 12:10:08 +02:00
Adam Weiss 234bfbf6a5 Add init scripts and docs for Upstart and OpenRC 2014-09-09 16:58:06 -04:00
Renamed from contrib/systemd/bitcoind.service (Browse further)