Improve systemd units

Use the same dependencies and their order in both systemd units.
Add additional units of services that kodi uses.
Don't use "Requires=", kodi can run without a network connection.
Export WINDOWING=x11 in kodi.service to skip the autodetection that /usr/bin/kodi-standalone performs.
Give kodi-gbm.service the privileges of input group, this allows removing the kodi user from that group's membership since kodi.service does not need it.
This commit is contained in:
nl6720 2019-10-30 18:32:01 +02:00 committed by graysky
parent ec902b8f97
commit 92036950d8
4 changed files with 8 additions and 7 deletions

2
MIT
View File

@ -1,4 +1,4 @@
Copyright (c) 2014-2019 graysky
Copyright (c) 2014-2020 graysky
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -11,7 +11,7 @@ Users of Arch ARM should NOT use this method as the distro package provides anal
### 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,input,network,optical,uucp,video \
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

View File

@ -1,13 +1,13 @@
[Unit]
Description=Kodi standalone (GBM)
After=systemd-user-sessions.service network.target network-online.target sound.target upower.service mysqld.service
Requires=graphical.target
Wants=network.target network-online.target
After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service
Wants=network-online.target polkit.service upower.service
Conflicts=getty@tty1.service
[Service]
User=kodi
Group=kodi
SupplementaryGroups=input
PAMName=login
TTYPath=/dev/tty1
Environment=WINDOWING=gbm

View File

@ -1,7 +1,7 @@
[Unit]
Description=Kodi standalone (X11)
After=systemd-user-sessions.service network-online.target sound.target mysqld.service
Requires=network-online.target
After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service
Wants=network-online.target polkit.service upower.service
Conflicts=getty@tty1.service
[Service]
@ -9,6 +9,7 @@ User=kodi
Group=kodi
PAMName=login
TTYPath=/dev/tty1
Environment=WINDOWING=x11
ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt1
Restart=on-abort
StandardInput=tty