From 546b6863a4392c98cc34dec8ded0e19be25006fb Mon Sep 17 00:00:00 2001 From: graysky Date: Sun, 23 May 2021 06:38:08 -0400 Subject: [PATCH] supply empty file for environment variables --- Makefile | 4 ++++ README.md | 3 +-- arm/doc/kodi.service.1 | 4 ++-- arm/doc/manpage.txt | 2 +- arm/init/sysusers.conf | 2 +- common/kodi-standalone | 1 + x86/doc/kodi.service.1 | 4 ++-- 7 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 common/kodi-standalone diff --git a/Makefile b/Makefile index 4f9b551..0cb5d3f 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ USERDIR = $(PREFIX)/lib/sysusers.d TMPFDIR = $(PREFIX)/lib/tmpfiles.d UDEVDIR = $(PREFIX)/lib/udev/rules.d MANDIR = $(PREFIX)/share/man/man1 +ENVDIR = /etc/conf.d RM = rm INSTALL = install -p @@ -19,7 +20,9 @@ common/$(PN): install-common: $(INSTALL_DIR) "$(DESTDIR)$(UDEVDIR)" + $(INSTALL_DIR) "$(DESTDIR)$(ENVDIR)" $(INSTALL_DATA) x86/udev/99-kodi.rules "$(DESTDIR)$(UDEVDIR)/99-kodi.rules" + $(INSTALL_DATA) common/kodi-standalone "$(DESTDIR)$(ENVDIR)/kodi-standalone" install-init: $(INSTALL_DIR) "$(DESTDIR)$(INITDIR)" @@ -43,6 +46,7 @@ uninstall: $(RM) "$(DESTDIR)$(USERDIR)/kodi-standalone.conf" $(RM) "$(DESTDIR)$(UDEVDIR)/99-kodi.rules" $(RM) "$(DESTDIR)$(MANDIR)/kodi.service.1" + $(RM) "$(DESTDIR)$(ENVDIR)/kodi-standalone" install: install-common install-init install-man diff --git a/README.md b/README.md index 75d1622..8594224 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,9 @@ Simply [start/enable](https://wiki.archlinux.org/index.php/Systemd#Using_units) * xorg-server and xorg-xinit (for running x11) ## Passing environment variables to the service -Should the need arise, one can pass environment variables to the service by creating `/etc/conf.d/kodi-standalone` and populating it with the needed variables. +Certain use cases require environment variables to be passed to the service. Define these variables in `/etc/conf.d/kodi-standalone` and they will be passed along to the service. ## Notes on system shutdown/reboot - Be aware that these services run Kodi in systemd's user.slice not in the system.slice. In order to have Kodi gracefully exit, the system should be called to shutdown or to reboot using the respective Kodi actions not by a call to systemctl. Failure to do so will result in an ungraceful exit of Kodi and the saving of GUI settings, Kodi uptime etc. will not occur. In principal this is no different than data loss occurring from a user doing work when a sysadmin issues a reboot command without prior warning. While it is possible to run Kodi in systemd's system.slice instead, doing so makes it difficult to use USB mounts within Kodi and to use pulseaudio for Kodi sessions. ### Recommended methods to reboot/shutdown diff --git a/arm/doc/kodi.service.1 b/arm/doc/kodi.service.1 index cf0286e..52a6497 100644 --- a/arm/doc/kodi.service.1 +++ b/arm/doc/kodi.service.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH kodi.service 1 "13 March 2021" "" "" +.TH kodi.service 1 "23 May 2021" "" "" .SH NAME \fBkodi.service \fP- Systemd service unit to run Kodi in standalone mode without the need for a DE. \fB @@ -35,7 +35,7 @@ If a CLI option is preferred, use kodi-send to issue the command to reboot or sh .fi Note that kodi-send is provided by the kodi-xxx-eventclients package where xxx is either, rpi, rpi-legacy, or git depending on which package group you installed. .SH PASSING ENVIRONMENT VARIABLES TO THE SERVICE -Should the need arise, one can pass environment variables to the service by creating /etc/conf.d/kodi-standalone and populating it with the needed variables. +Certain use cases require environment variables to be passed to the service. Define these variables in /etc/conf.d/kodi-standalone and they will be passed along to the service. .SH CONTRIBUTE Users wishing to contribute to this code, should fork and send a pull request. Source is freely available on the project page linked below. .SH BUGS diff --git a/arm/doc/manpage.txt b/arm/doc/manpage.txt index 7e050d3..aed2646 100644 --- a/arm/doc/manpage.txt +++ b/arm/doc/manpage.txt @@ -24,7 +24,7 @@ o If a CLI option is preferred, use kodi-send to issue the command to reboot or Note that kodi-send is provided by the kodi-xxx-eventclients package where xxx is either, rpi, rpi-legacy, or git depending on which package group you installed. PASSING ENVIRONMENT VARIABLES TO THE SERVICE -Should the need arise, one can pass environment variables to the service by creating /etc/conf.d/kodi-standalone and populating it with the needed variables. +Certain use cases require environment variables to be passed to the service. Define these variables in /etc/conf.d/kodi-standalone and they will be passed along to the service. CONTRIBUTE Users wishing to contribute to this code, should fork and send a pull request. Source is freely available on the project page linked below. diff --git a/arm/init/sysusers.conf b/arm/init/sysusers.conf index 2498fe5..5023975 100644 --- a/arm/init/sysusers.conf +++ b/arm/init/sysusers.conf @@ -1,6 +1,6 @@ # override these settings by copying this to /etc/sysusers.d/ and modifying it therein -#Type Name ID GECOS Home directory Shell +# Type Name ID GECOS Home directory Shell g kodi - - u kodi - "Kodi User" /var/lib/kodi diff --git a/common/kodi-standalone b/common/kodi-standalone new file mode 100644 index 0000000..aa57617 --- /dev/null +++ b/common/kodi-standalone @@ -0,0 +1 @@ +# Define environment variables to pass to the service below diff --git a/x86/doc/kodi.service.1 b/x86/doc/kodi.service.1 index 8d7d5cd..e8ebcd7 100644 --- a/x86/doc/kodi.service.1 +++ b/x86/doc/kodi.service.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH kodi.service 1 "03 April 2021" "" "" +.TH kodi.service 1 "23 May 2021" "" "" .SH NAME \fBkodi-xxx.service \fP- Systemd service units to run Kodi in standalone mode without the need for a DE. \fB @@ -43,7 +43,7 @@ If a CLI option is preferred, use kodi-send to issue the command to reboot or sh .fi Note that kodi-send may not be included with your Distro's kodi package. For example, on Arch Linux, it is provided by the kodi-eventclients package. .SH PASSING ENVIRONMENT VARIABLES TO THE SERVICE -Should the need arise, one can pass environment variables to the service by creating /etc/conf.d/kodi-standalone and populating it with the needed variables. +Certain use cases require environment variables to be passed to the service. Define these variables in /etc/conf.d/kodi-standalone and they will be passed along to the service. .SH CONTRIBUTE Users wishing to contribute to this code, should fork and send a pull request. Source is freely available on the project page linked below. .SH BUGS