diff --git a/README.md b/README.md index dc20a03..82afc83 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,15 @@ For the kodi user to access devices on `/dev/ttyxxxx`, users will need to edit ` ### Other distros (manual installation) Users of other distros can just run `make install` as the root user. Then, as the root user: +<<<<<<< HEAD * Run `systemd-sysusers` * Run `systemd-tmpfiles --create` * Run `udevadm control --reload-rules && udevadm trigger` +======= +* `init/*.service` to `/usr/lib/systemd/system/` +* `init/sysusers.conf` to `/usr/lib/sysusers.d/`, then run `systemd-sysusers` +* `init/tmpfiles.conf` to `/usr/lib/tmpfiles.d/`, then run `systemd-tmpfiles --create` +>>>>>>> parent of 34515c3 (Consistent behavior on a systemctl stop vs reboot) 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/init/kodi-gbm.service b/init/kodi-gbm.service index 424829d..eb6e81d 100644 --- a/init/kodi-gbm.service +++ b/init/kodi-gbm.service @@ -1,6 +1,6 @@ [Unit] Description=Kodi standalone (GBM) -After=remote-fs.target network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service +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 @@ -9,6 +9,7 @@ User=kodi Group=kodi EnvironmentFile=-/etc/conf.d/kodi-standalone SupplementaryGroups=input +PAMName=login TTYPath=/dev/tty1 Environment=WINDOWING=gbm ExecStart=/usr/bin/kodi-standalone diff --git a/init/kodi-wayland.service b/init/kodi-wayland.service index 8c3c199..1fe0920 100644 --- a/init/kodi-wayland.service +++ b/init/kodi-wayland.service @@ -1,6 +1,6 @@ [Unit] Description=Kodi standalone (Wayland) -After=remote-fs.target network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service +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 @@ -10,6 +10,7 @@ Group=kodi RuntimeDirectory=kodi Environment="XDG_RUNTIME_DIR=%t/kodi" EnvironmentFile=-/etc/conf.d/kodi-standalone +PAMName=login TTYPath=/dev/tty1 Environment=WINDOWING=wayland ExecStart=/usr/bin/cage -- /usr/bin/kodi-standalone diff --git a/init/kodi-x11.service b/init/kodi-x11.service index 2d2218a..26774ab 100644 --- a/init/kodi-x11.service +++ b/init/kodi-x11.service @@ -1,6 +1,6 @@ [Unit] Description=Kodi standalone (X11) -After=remote-fs.target network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service +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 @@ -8,6 +8,7 @@ Conflicts=getty@tty1.service User=kodi Group=kodi EnvironmentFile=-/etc/conf.d/kodi-standalone +PAMName=login TTYPath=/dev/tty1 Environment=WINDOWING=x11 ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -quiet -nolisten tcp vt1 @@ -15,11 +16,6 @@ ExecStop=/usr/bin/killall --user kodi --exact --wait kodi-x11 Restart=on-abort StandardInput=tty StandardOutput=journal -# Without this we will wait the default 90s for this service to go down -# due to xinit staying alive. I don't know of a better way to do this -# without several service files one for the xserver and another for kodi. -# If this bothers you, run kodi-gbm instead which doesn't suffer from this. -TimeoutStopSec=10s [Install] Alias=display-manager.service diff --git a/init/sysusers.conf b/init/sysusers.conf index 5b0837f..4ef0b7d 100644 --- a/init/sysusers.conf +++ b/init/sysusers.conf @@ -5,18 +5,16 @@ g kodi - - u kodi - "Kodi User" /var/lib/kodi # supplemental groups -# see: https://wiki.archlinux.org/index.php/Users_and_groups#Pre-systemd_groups m kodi audio -m kodi input m kodi optical m kodi video # other groups, see: /usr/lib/sysusers.d/arch.conf or basic.conf -# m kodi network -# m kodi power -# m kodi tty -# m kodi disk -# m kodi storage +# m kodi network +# m kodi power +# m kodi tty +# m kodi disk +# m kodi storage # uncomment the following line for Ubunutu users needing access to /etc/ttyxxxx # https://github.com/graysky2/kodi-standalone-service/issues/14 diff --git a/polkit/10-kodi.rules b/polkit/10-kodi.rules deleted file mode 100644 index bcf7abf..0000000 --- a/polkit/10-kodi.rules +++ /dev/null @@ -1,15 +0,0 @@ -polkit.addRule(function(action, subject) { - if (subject.user == "kodi") { - polkit.log("action=" + action); - polkit.log("subject=" + subject); - if (action.id.indexOf("org.freedesktop.login1.") == 0) { - return polkit.Result.YES; - } - if (action.id.indexOf("org.freedesktop.udisks.") == 0) { - return polkit.Result.YES; - } - if (action.id.indexOf("org.freedesktop.udisks2.") == 0) { - return polkit.Result.YES; - } - } -});