From 27b139b03c23e3d0b86bcf27a1a2603fb50c9439 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 24 Apr 2024 10:03:39 +0100 Subject: Rewrite systemd instructions --- README.md | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 14abe54..24f7b18 100644 --- a/README.md +++ b/README.md @@ -310,30 +310,35 @@ spam your notification channels for every transaction. The ideal use-case is as a long running daemon, so it makes sense to configure it as a systemd service. -If you are installing `sentrum` manually (e.g. from the releases page), you -should: +If you installed sentrum from the AUR, you just need to edit +`/etc/sentrum/sentrum.conf` and do `sudo systemclt enable --now sentrum.service` -1. Create a new `sentrum` user: +If you are installing `sentrum` manually (e.g. from the releases page or `cargo +install`), you should (either from the cloned repository or from inside the +extracted release archive): + +1. Copy systemd files to appropriate places: ```bash -sudo useradd -d /var/lib/sentrum -m sentrum +sudo cp contrib/systemd/sentrum.service +sudo cp contrib/systemd/sentrum.sysusers /etc/sysusers.d/sentrum.conf +sudo cp contrib/systemd/sentrum.tmpfiles /etc/tmpfiles.d/sentrum.conf ``` -2. Place the `sentrum.toml` configuration file in `/etc/sentrum`: +2. Reload systemd daemon, sysusers and tmpfiles: ```bash -sudo mkdir -p /etc/sentrum -sudo cp sentrum.toml /etc/sentrum -sudo chown -R sentrum:sentrum /etc/sentrum +sudo systemclt daemon-reload +sudo systemd-sysusers +sudo systemd-tmpfiles --create ``` -3. Copy the [contrib/sentrum.service](contrib/sentrum.service) into the - `/etc/systemd/system` - -3. Reload systemd so that the service file can be found: +3. Place the `sentrum.toml` (or `sentrum.sample.toml`) configuration file in +`/etc/sentrum` and make sure the `sentrum` user owns it: ```bash -sudo systemclt daemon-reload +sudo cp sentrum.toml /etc/sentrum +sudo chown sentrum:sentrum /etc/sentrum/sentrum.toml ``` 4. Enable and start the service: -- cgit v1.2.3-70-g09d2