From fa8e068e24196ef59e43f78b0decee1e8c6eafe0 Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Mon, 25 Sep 2023 22:09:52 +0200 Subject: [PATCH] Add Run with Systemd docs (#111) Co-authored-by: Cyberes <64224601+cyberes@users.noreply.github.com> --- docs/administration/run-with-systemd.md | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docs/administration/run-with-systemd.md diff --git a/docs/administration/run-with-systemd.md b/docs/administration/run-with-systemd.md new file mode 100644 index 0000000..cb08bd2 --- /dev/null +++ b/docs/administration/run-with-systemd.md @@ -0,0 +1,47 @@ +# Run with Systemd + +For non-Docker users, you could run Opengist as a systemd service. + +On Unix distributions with systemd, place the Opengist binary like: + +```shell +sudo cp opengist /usr/local/bin +sudo mkdir -p /var/lib/opengist +sudo cp config.yml /etc/opengist +``` + +Edit the Opengist home directory configuration in `/etc/opengist/config.yml` like: +```shell +opengist-home: /var/lib/opengist +``` + +Create a new user to run Opengist: +```shell +sudo useradd --system opengist +sudo mkdir -p /var/lib/opengist +sudo chown -R opengist:opengist /var/lib/opengist +``` + +Then create a service file at `/etc/systemd/system/opengist.service`: +```ini +[Unit] +Description=opengist Server +After=network.target + +[Service] +Type=simple +User=opengist +Group=opengist +ExecStart=opengist --config /etc/opengist/config.yml +Restart=on-failure + +[Install] +WantedBy=multi-user.target +``` + +Finally, start the service: +```shell +systemctl daemon-reload +systemctl enable --now opengist +systemctl status opengist +```