From 92036950d804ce3421f01f6e8a65ad510bdc2a2a Mon Sep 17 00:00:00 2001 From: nl6720 Date: Wed, 30 Oct 2019 18:32:01 +0200 Subject: [PATCH] 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. --- MIT | 2 +- README.md | 2 +- init/kodi-gbm.service | 6 +++--- init/kodi.service | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/MIT b/MIT index dd3ffbb..320b71e 100644 --- a/MIT +++ b/MIT @@ -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: diff --git a/README.md b/README.md index 9177d83..469c1cd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/init/kodi-gbm.service b/init/kodi-gbm.service index bfec1f8..1547550 100644 --- a/init/kodi-gbm.service +++ b/init/kodi-gbm.service @@ -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 diff --git a/init/kodi.service b/init/kodi.service index a0dc268..7b84c89 100644 --- a/init/kodi.service +++ b/init/kodi.service @@ -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