From 8c5d854a369ce80369251d7f4a10a3bb37542abb Mon Sep 17 00:00:00 2001 From: graysky Date: Sun, 3 Jan 2021 17:55:15 -0500 Subject: [PATCH] back to user.slice It seems that as long as the Kodi menu is used to call a shutdown or reboot, the services will allow the application to gracefully exit including saving settings, uptime etc. This will only NOT occur if the user calls the box to shutdown or reboot via a call to systemctl for the reasons cited in previous commits. While not optimal, it is consistent with the same thing happening if others users are logged into the box, working, and a sysadmin calls the systemctl to reboot. The result is users will lose work/data. Going back to the user.slice is better for USB mounts, and for pulseaudio sessions as well. --- Makefile | 11 ++--------- README.md | 11 ----------- init/sysusers.conf | 10 +++++----- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index b83f0c7..af23203 100644 --- a/Makefile +++ b/Makefile @@ -4,23 +4,17 @@ PREFIX ?= /usr INITDIR = $(PREFIX)/lib/systemd/system USERDIR = $(PREFIX)/lib/sysusers.d TMPFDIR = $(PREFIX)/lib/tmpfiles.d -POLKDIR = $(PREFIX)/share/polkit-1/rules.d RM = rm INSTALL = install -p INSTALL_DIR = $(INSTALL) -d INSTALL_PROGRAM = $(INSTALL) -m755 INSTALL_DATA = $(INSTALL) -m644 -INSTALL_POLK = $(INSTALL_DIR) -m750 common/$(PN): @echo -e '\033[1;32mNothing to be done.\033[0m' @echo -e '\033[1;32mJust run make install as root.\033[0m' -install-common: - $(INSTALL_POLK) "$(DESTDIR)$(POLKDIR)" - $(INSTALL_DATA) polkit/10-kodi.rules "$(DESTDIR)$(POLKDIR)/10-kodi.rules" - install-init: $(INSTALL_DIR) "$(DESTDIR)$(INITDIR)" $(INSTALL_DIR) "$(DESTDIR)$(USERDIR)" @@ -37,8 +31,7 @@ uninstall: $(RM) "$(DESTDIR)$(INITDIR)/kodi-x11.service" $(RM) "$(DESTDIR)$(TMPFDIR)/kodi-standalone.conf" $(RM) "$(DESTDIR)$(USERDIR)/kodi-standalone.conf" - $(RM) "$(DESTDIR)$(POLKDIR)/10-kodi.rules" -install: install-common install-init +install: install-init -.PHONY: install-common install-init uninstall +.PHONY: install-init uninstall diff --git a/README.md b/README.md index 82afc83..c8ad682 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,8 @@ 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. @@ -39,7 +32,6 @@ Simply [start/enable](https://wiki.archlinux.org/index.php/Systemd#Using_units) * kodi (x11 or wayland or gbm) * libinput and cage (for running wayland) * libinput (for running gbm) -* polkit * xorg-server and xorg-xinit (for running x11) ## Passing environment variables to the service @@ -49,9 +41,6 @@ Should the need arise, one can pass environment variables to the service by crea Much of the credit for this service goes to the Arch Linux maintainers of the official kodi package. Note that they removed it upon the [1.16-1 release of Xorg](https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/xbmc&id=9763c6d32678f3a3f45c195bfae92eee209d504f). ## Tips and Tricks -### Pulseaudio -Currently, users of pulseaudio will need configure it to run in [system mode](https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/) to work with these service files. - ### Service not starting Most users should not need `/etc/X11/Xwrapper.config` since the created X server becomes the [controlling process](http://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardInput=) of the VT to which it is bound. Most users does not mean all users. There have been reports of some AMD users still requiring this file. As well, users of Xorg's native modesetting driver may also require it. diff --git a/init/sysusers.conf b/init/sysusers.conf index 4ef0b7d..fee3f3d 100644 --- a/init/sysusers.conf +++ b/init/sysusers.conf @@ -10,11 +10,11 @@ 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