From 08c181760f53990bcfa6593fe1a00c2af271ea14 Mon Sep 17 00:00:00 2001 From: morph027 Date: Tue, 19 May 2020 15:37:36 +0200 Subject: [PATCH] add systemd to docs --- README.md | 29 +++++++++++++++++++++++++++++ dist/init/systemd/signaling.service | 11 +++++++++++ 2 files changed, 40 insertions(+) create mode 100644 dist/init/systemd/signaling.service diff --git a/README.md b/README.md index a38fa6c..e16ee07 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,35 @@ directory, but a different path can be passed through the `--config` option. $ ./bin/signaling --config /etc/signaling/server.conf +### Running as daemon + +#### systemd + +Create a dedicated user: + +```bash +sudo useradd --system \ + --gid signaling \ + --shell /usr/sbin/nologin \ + --comment "Standalone signaling server for Nextcloud Talk." \ + signaling +``` + +Copy `server.conf.in` to `/etc/signaling/server.conf` and fix permissions: + +```bash +sudo chmod 600 /etc/signaling/server.conf +sudo chown signaling: /etc/signaling/server.conf +``` + +Copy `dist/init/systemd/signaling.service` to `/etc/systemd/system/signaling.service` (adjust abs. path in `ExecStart` to match your binary location!) + +Enable and start service: + +```bash +systemctl enable signaling.service +systemctl start signaling.service +``` ## Setup of NATS server diff --git a/dist/init/systemd/signaling.service b/dist/init/systemd/signaling.service new file mode 100644 index 0000000..a1b6517 --- /dev/null +++ b/dist/init/systemd/signaling.service @@ -0,0 +1,11 @@ +[Unit] +Description=Nextcloud Talk signaling server + +[Service] +ExecStart=/usr/bin/signaling --config /etc/signaling/server.conf +User=signaling +Group=signaling +Restart=on-failure + +[Install] +WantedBy=multi-user.target