Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 353492 | Differences between
and this patch

Collapse All | Expand All

(-)gentoo-vdr-scripts-2.5_rc1_orig/etc/conf.d/vdr (+4 lines)
Lines 225-230 Link Here
225
# and who want to start vdr as user root
225
# and who want to start vdr as user root
226
#   allowed values: yes no
226
#   allowed values: yes no
227
#   default: no
227
#   default: no
228
# WILL BE IGNORED IF USING SYSTEMD !!!
229
# Enable the 'User=root' key under the [Service] section in
230
# /etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf
231
# only if you want to run vdr as user root and use systemd
228
#START_VDR_AS_ROOT="no"
232
#START_VDR_AS_ROOT="no"
229
233
230
# Use only the given DVB device (NUM = 0, 1, 2...)
234
# Use only the given DVB device (NUM = 0, 1, 2...)
(-)gentoo-vdr-scripts-2.5_rc1_orig/etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf (-12 / +7 lines)
Lines 3-18 Link Here
3
#
3
#
4
# use this file to override settings from vdr.service
4
# use this file to override settings from vdr.service
5
5
6
## need testing, which one will work
6
[Service]
7
7
# Uncomment this if you need to run vdr as root.
8
# test1
8
# ATTENTION !!!
9
#[Service]
9
# - START_VDR_AS_ROOT from /etc/conf.d/vdr IS IGNORED WHEN USING SYSTEMD !!!
10
# uncomment this if you have to set START_VDR_AS_ROOT="yes" in /etc/conf.d/vdr
10
# - if you use the dbus2vdr plugin, the user who owns the vdr-dbus-service
11
# has to also be set in /etc/dbus-1/system.d/de.tvdr.vdr.conf as root if
12
# you uncomment the line below
11
#User=root
13
#User=root
12
13
# test2
14
# For people who really know what they do
15
# and who want to start vdr as user root
16
#   allowed values: yes no
17
#   default: no
18
#START_VDR_AS_ROOT="no"
(-)gentoo-vdr-scripts-2.5_rc1_orig/usr/lib/systemd/system/vdr.service (-1 / +1 lines)
Lines 18-24 Link Here
18
18
19
# start VDR with our desired parameters, please disable the
19
# start VDR with our desired parameters, please disable the
20
# internal watchdog by setting the timeout to 0
20
# internal watchdog by setting the timeout to 0
21
ExecStart=/usr/bin/vdr ${VDR_OPTS}
21
ExecStart=/usr/bin/vdr "$VDR_OPTS"
22
22
23
# execute addons/plugins scripts meant to be run afer starting
23
# execute addons/plugins scripts meant to be run afer starting
24
ExecStartPost=/usr/share/vdr/systemd/vdr-systemd_helper.sh --start-post
24
ExecStartPost=/usr/share/vdr/systemd/vdr-systemd_helper.sh --start-post
(-)gentoo-vdr-scripts-2.5_rc1_orig/usr/share/vdr/systemd/vdr-systemd_helper.sh (-14 / +4 lines)
Lines 20-26 Link Here
20
20
21
include rc-functions
21
include rc-functions
22
include plugin-functions
22
include plugin-functions
23
#init_tmp_dirs
23
init_tmp_dirs
24
24
25
VDR_LOG_FILE="${PL_TMP}/vdr-start-log"
25
VDR_LOG_FILE="${PL_TMP}/vdr-start-log"
26
26
Lines 29-45 Link Here
29
29
30
#common_init
30
#common_init
31
31
32
# grep the user on who should vdr systemd running
33
# 2 values, vdr or root
34
run_as_user() {
35
. /etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf
36
37
	if yesno "${START_VDR_AS_ROOT}"; then
38
		systemd_vdr_user="root"
39
	else
40
		systemd_vdr_user="vdr"
41
	fi
42
}
43
32
44
# dummy functions to make the rest of gentoo-vdr-scripts happy,
33
# dummy functions to make the rest of gentoo-vdr-scripts happy,
45
# as we do not want to rely on openrc's implementations of these
34
# as we do not want to rely on openrc's implementations of these
Lines 102-111 Link Here
102
	init_params
91
	init_params
103
	init_plugin_loader start || eexitfail "init_plugin_loader start"
92
	init_plugin_loader start || eexitfail "init_plugin_loader start"
104
	load_addons_prefixed pre-start || eexitfail "load_addons_prefixed pre-start"
93
	load_addons_prefixed pre-start || eexitfail "load_addons_prefixed pre-start"
105
	run_as_user
106
	# these options are what we need to start VDR from the systemd unit file
94
	# these options are what we need to start VDR from the systemd unit file
107
	echo "VDR_OPTS=\"${vdr_opts}\"" > ${SYSTEMD_ENV_FILE}
95
	echo "VDR_OPTS=\"${vdr_opts}\"" > ${SYSTEMD_ENV_FILE}
108
	echo "SYSTEMD_VDR_USER=\"${sytemd_vdr_user}\"" >> ${SYSTEMD_ENV_FILE}
96
	# remove the command line --user argument if set by the scripts so far,
97
	# as the user under which vdr will run is controlled by systemd
98
	sed -e "s:'-u' 'vdr' ::" -i ${SYSTEMD_ENV_FILE}
109
	sync
99
	sync
110
	eend "--start-pre"
100
	eend "--start-pre"
111
elif [ "$1" = "--start-post" ]; then
101
elif [ "$1" = "--start-post" ]; then

Return to bug 353492