From 6ebf24b1d59417467864e1c3e41f5f78718d89d6 Mon Sep 17 00:00:00 2001 From: Jan Hicken Date: Sun, 5 Jan 2020 12:53:12 +0100 Subject: [PATCH] Use systemd-tmpfiles and systemd-sysusers --- README.md | 13 ++++--------- sysusers.conf | 10 ++++++++++ tmpfiles.conf | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 sysusers.conf create mode 100644 tmpfiles.conf diff --git a/README.md b/README.md index 469c1cd..fc9fb2b 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,11 @@ Arch Linux users can find a PKGBUILD in the [AUR](https://aur.archlinux.org/pack Users of Arch ARM should NOT use this method as the distro package provides analogous functionality. ### Other distros -Users of other distros should copy `kodi.service` and `kodi-gbm.service` to `/usr/lib/systemd/system/` and should create both a kodi user and home directory as follows: -``` - useradd -c 'kodi user' -u 420 -g kodi -G audio,network,optical,uucp,video \ - -d /var/lib/kodi -s /usr/bin/nologin kodi +Users of other distros should install the following files: - passwd -l kodi > /dev/null - - mkdir /var/lib/kodi - chown -R kodi:kodi /var/lib/kodi -``` +* `init/kodi.service` and `init/kodi-gbm.service` to `/usr/lib/systemd/system` +* `sysusers.conf` to `/usr/lib/sysusers.d`, then run `systemd-sysusers` +* `tmpfiles.conf` to `/usr/lib/tmpfiles.d`, then run `systemd-tmpfiles --create` Note that the kodi user's home directory is `/var/lib/kodi/` in this example, NOT `/home/kodi/` like a regular user. diff --git a/sysusers.conf b/sysusers.conf new file mode 100644 index 0000000..0bd26dc --- /dev/null +++ b/sysusers.conf @@ -0,0 +1,10 @@ +# == System users == +# user uid descr home +u kodi - Kodi /var/lib/kodi + +# == Group memberships == +# user group +m kodi audio +m kodi optical +m kodi uucp +m kodi video diff --git a/tmpfiles.conf b/tmpfiles.conf new file mode 100644 index 0000000..8f2f9b6 --- /dev/null +++ b/tmpfiles.conf @@ -0,0 +1 @@ +d /var/lib/kodi 0700 kodi kodi -