From bfec9d974b5108acec273f894cab5f36ef793e39 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Sat, 26 Oct 2019 13:08:36 +0300 Subject: [PATCH] docs: Create Advanced Post-installation Tasks section; move systemd stuff there --- docs/advanced-setup.md | 33 +++++++++++++++++++++++++++++++++ docs/installation.md | 30 +++--------------------------- mkdocs.yml | 1 + 3 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 docs/advanced-setup.md diff --git a/docs/advanced-setup.md b/docs/advanced-setup.md new file mode 100644 index 000000000..e6334d2c1 --- /dev/null +++ b/docs/advanced-setup.md @@ -0,0 +1,33 @@ +# Advanced Post-installation Tasks + +This page explains some advanced tasks and configuration options that can be performed after the bot installation and may be uselful in some environments. + +If you do not know what things mentioned here mean, you probably do not need it. + +## Configure the bot running as a systemd service + +Copy the `freqtrade.service` file to your systemd user directory (usually `~/.config/systemd/user`) and update `WorkingDirectory` and `ExecStart` to match your setup. + +After that you can start the daemon with: + +```bash +systemctl --user start freqtrade +``` + +For this to be persistent (run when user is logged out) you'll need to enable `linger` for your freqtrade user. + +```bash +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. diff --git a/docs/installation.md b/docs/installation.md index 68348d4b0..e1e101efd 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -151,7 +151,7 @@ python3 -m venv .env source .env/bin/activate ``` -#### 3. Install FreqTrade +#### 3. Install Freqtrade Clone the git repository: @@ -192,33 +192,9 @@ freqtrade -c config.json *Note*: If you run the bot on a server, you should consider using [Docker](docker.md) or a terminal multiplexer like `screen` or [`tmux`](https://en.wikipedia.org/wiki/Tmux) to avoid that the bot is stopped on logout. -#### 7. [Optional] Configure `freqtrade` as a `systemd` service +#### 7. (Optional) Post-installation Tasks -From the freqtrade repo... copy `freqtrade.service` to your systemd user directory (usually `~/.config/systemd/user`) and update `WorkingDirectory` and `ExecStart` to match your setup. - -After that you can start the daemon with: - -```bash -systemctl --user start freqtrade -``` - -For this to be persistent (run when user is logged out) you'll need to enable `linger` for your freqtrade user. - -```bash -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. +You can also optionally setup the bot to run as a `systemd` service and configure it to send the log messages to the `syslog`/`rsyslog` or `journald` daemons. See [Advanced Post-installation Tasks](advanced-setup.md) for details. ------ diff --git a/mkdocs.yml b/mkdocs.yml index 863731873..2c3f70191 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,6 +22,7 @@ nav: - Strategy analysis: strategy_analysis_example.md - Plotting: plotting.md - SQL Cheatsheet: sql_cheatsheet.md + - Advanced Post-installation Tasks: advanced-setup.md - Sandbox Testing: sandbox-testing.md - Deprecated Features: deprecated.md - Contributors Guide: developer.md