Support for systemd watchdog via sd_notify
This commit is contained in:
@@ -38,7 +38,7 @@ optional arguments:
|
||||
--db-url PATH Override trades database URL, this is useful if
|
||||
dry_run is enabled or in custom deployments (default:
|
||||
None).
|
||||
|
||||
--sd-notify Notify systemd service manager.
|
||||
```
|
||||
|
||||
### How to use a different configuration file?
|
||||
|
@@ -67,6 +67,7 @@ Mandatory Parameters are marked as **Required**.
|
||||
| `strategy` | DefaultStrategy | Defines Strategy class to use.
|
||||
| `strategy_path` | null | Adds an additional strategy lookup path (must be a folder).
|
||||
| `internals.process_throttle_secs` | 5 | **Required.** Set the process throttle. Value in second.
|
||||
| `internals.sd_notify` | false | Enables use of the sd_notify protocol to tell systemd service manager about changes in the bot state and issue keep-alive pings. See [here](installation.md#7-optional-configure-freqtrade-as-a-systemd-service) for more details.
|
||||
|
||||
### Parameters in the strategy
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user