Support for systemd watchdog via sd_notify

This commit is contained in:
hroff-1902
2019-03-10 20:05:33 +03:00
parent e14739e102
commit 8730852d6e
9 changed files with 97 additions and 13 deletions

View File

@@ -428,6 +428,19 @@ For this to be persistent (run when user is logged out) you'll need to enable `l
sudo loginctl enable-linger "$USER"
```
If you run the bot as a service, you can use systemd service manager as a software watchdog monitoring freqtrade bot
state and restarting it in the case of failures. If the `internals.sd_notify` parameter is set to true in the
configuration or the `--sd-notify` command line option is used, the bot will send keep-alive ping messages to systemd
using the sd_notify (systemd notifications) protocol and will also tell systemd its current state (Running or Stopped)
when it changes.
The `freqtrade.service.watchdog` file contains an example of the service unit configuration file which uses systemd
as the watchdog.
!!! Note:
The sd_notify communication between the bot and the systemd service manager will not work if the bot runs in a
Docker container.
------
## Windows