From afb4b2ccef880fa5533b873b79280baf210684b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?elm=C3=B8?= Date: Sun, 6 Aug 2023 23:55:07 +0200 Subject: [PATCH] docs: update selinux instructions --- src/docs/markdown/running.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/docs/markdown/running.md b/src/docs/markdown/running.md index 69d1327..bc5549a 100644 --- a/src/docs/markdown/running.md +++ b/src/docs/markdown/running.md @@ -157,17 +157,10 @@ Then, save the file and exit the text editor, and restart the service for it to On SELinux enabled systems, systemd unit files and their executables will not be run unless labelled with `systemd_unit_file_t` and `bin_t` respectively. -Moreover on some distros (Fedora), SELinux will not let you relabel files directly placed in `/etc/systemd/system`. Instead unit files inside `/etc/systemd/system/` are symlinks to `/usr/lib/systemd/system/`. - -If that is the case, you could create the `caddy.service` file inside the `/usr/lib/` directory and symlink it to `/etc/systemd/system/caddy.service`. +The `systemd_unit_file_t` is automatically applied to files created in `/etc/systemd/...`, so be sure to create your `caddy.service` file there. +To tag the caddy binary, you can use the following commands: ```shell -### symlink the file if your selinux policy doesn't allow labelling files in /etc/systemd/ -ln -s /usr/lib/systemd/system/caddy.service /etc/systemd/system/caddy.service - -semanage fcontext -a -t systemd_unit_file_t PATH_TO_UNIT_FILE -restorecon -Rv PATH_TO_UNIT_FILE - semanage fcontext -a -t bin_t /usr/bin/caddy restorecon -Rv /usr/bin/caddy ```