Merge pull request #12 from janhicken/feature/systemd-sysusers-and-tmpfiles

Use systemd-tmpfiles and systemd-sysusers
This commit is contained in:
graysky 2020-01-05 18:36:35 -05:00 committed by GitHub
commit 012ef7b5af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.
### 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.

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 -