Use systemd-tmpfiles and systemd-sysusers

This commit is contained in:
Jan Hicken 2020-01-05 12:53:12 +01:00
parent 92036950d8
commit 6ebf24b1d5
3 changed files with 15 additions and 9 deletions

View File

@ -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. Users of Arch ARM should NOT use this method as the distro package provides analogous functionality.
### Other distros ### 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: Users of other distros should install the following files:
```
useradd -c 'kodi user' -u 420 -g kodi -G audio,network,optical,uucp,video \
-d /var/lib/kodi -s /usr/bin/nologin kodi
passwd -l kodi > /dev/null * `init/kodi.service` and `init/kodi-gbm.service` to `/usr/lib/systemd/system`
* `sysusers.conf` to `/usr/lib/sysusers.d`, then run `systemd-sysusers`
mkdir /var/lib/kodi * `tmpfiles.conf` to `/usr/lib/tmpfiles.d`, then run `systemd-tmpfiles --create`
chown -R kodi:kodi /var/lib/kodi
```
Note that the kodi user's home directory is `/var/lib/kodi/` in this example, NOT `/home/kodi/` like a regular user. Note that the kodi user's home directory is `/var/lib/kodi/` in this example, NOT `/home/kodi/` like a regular user.

10
sysusers.conf Normal file
View File

@ -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

1
tmpfiles.conf Normal file
View File

@ -0,0 +1 @@
d /var/lib/kodi 0700 kodi kodi -