aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Bornkessel <hd_brummy@gentoo.org>2014-02-15 20:37:56 +0100
committerJoerg Bornkessel <hd_brummy@gentoo.org>2014-02-15 20:37:56 +0100
commitbefeceb8f7230a1ecdaa913060f29b3bd2100c04 (patch)
tree50de15dc42066ac71da8a8798cdf95b8b826071a
parentsome fixes, reported by M.Perrudin (comment 28, #353492) (diff)
downloadgentoo-vdr-scripts-befeceb8f7230a1ecdaa913060f29b3bd2100c04.tar.gz
gentoo-vdr-scripts-befeceb8f7230a1ecdaa913060f29b3bd2100c04.tar.bz2
gentoo-vdr-scripts-befeceb8f7230a1ecdaa913060f29b3bd2100c04.zip
some fixes, reported by M.Perrudin (comment 28, #353492)
-rw-r--r--Makefile4
-rw-r--r--etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf12
-rw-r--r--usr/lib/systemd/system/vdr.service2
-rw-r--r--usr/share/vdr/systemd/vdr-systemd_helper.sh7
4 files changed, 20 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 3c110ef..6930a0c 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,8 @@ SHELL = /bin/bash
SUBDIRS = etc usr vdrplugin-rebuild
-SUBDIRS += usr/lib/systemd/system var/vdr/tmp
-# etc/systemd/system/vdr.service.d
+SUBDIRS += usr/lib/systemd/system var/vdr/tmp etc/systemd/system/vdr.service.d
+
all:
VERSION := $(shell grep '^Version' README | awk '{ print $$2 }')
diff --git a/etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf b/etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf
index 8f57598..98384c2 100644
--- a/etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf
+++ b/etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf
@@ -3,6 +3,16 @@
#
# use this file to override settings from vdr.service
-[Service]
+## need testing, which one will work
+
+# test1
+#[Service]
# uncomment this if you have to set START_VDR_AS_ROOT="yes" in /etc/conf.d/vdr
#User=root
+
+# test2
+# For people who really know what they do
+# and who want to start vdr as user root
+# allowed values: yes no
+# default: no
+#START_VDR_AS_ROOT="no" \ No newline at end of file
diff --git a/usr/lib/systemd/system/vdr.service b/usr/lib/systemd/system/vdr.service
index cfa171e..c9f204e 100644
--- a/usr/lib/systemd/system/vdr.service
+++ b/usr/lib/systemd/system/vdr.service
@@ -6,7 +6,7 @@ DefaultDependencies=no
[Service]
-User=${SYSTEMD_VDR_USER}
+User=vdr
# this will collect the parameters and set them into the VDR_OPTS
# variable in the EnvironmentFile
ExecStartPre=/usr/share/vdr/systemd/vdr-systemd_helper.sh --start-pre
diff --git a/usr/share/vdr/systemd/vdr-systemd_helper.sh b/usr/share/vdr/systemd/vdr-systemd_helper.sh
index 66919e3..a605585 100644
--- a/usr/share/vdr/systemd/vdr-systemd_helper.sh
+++ b/usr/share/vdr/systemd/vdr-systemd_helper.sh
@@ -17,10 +17,13 @@
cd /var/vdr
unset MAIL
. /usr/share/vdr/inc/functions.sh
+
include rc-functions
include plugin-functions
-init_tmp_dirs
+#init_tmp_dirs
+
VDR_LOG_FILE="${PL_TMP}/vdr-start-log"
+
# this is the environment file to pass user and parameters to the systemd unit file
SYSTEMD_ENV_FILE="${PL_TMP}/systemd_env"
@@ -29,6 +32,8 @@ SYSTEMD_ENV_FILE="${PL_TMP}/systemd_env"
# grep the user on who should vdr systemd running
# 2 values, vdr or root
run_as_user() {
+. /etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf
+
if yesno "${START_VDR_AS_ROOT}"; then
systemd_vdr_user="root"
else