Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 353492 - media-tv/gentoo-vdr-scripts: add systemd unit
Summary: media-tv/gentoo-vdr-scripts: add systemd unit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo VDR Project
URL:
Whiteboard:
Keywords: NeedPatch
Depends on: 496852
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2011-02-02 09:06 UTC by Lucian Muresan
Modified: 2015-01-01 17:55 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
VDR unit (service file) for systemd (vdr.service,1.32 KB, text/plain)
2011-02-02 09:10 UTC, Lucian Muresan
Details
VDR helper script needed by the unit file (vdr_helper.sh,2.23 KB, text/plain)
2011-02-02 09:12 UTC, Lucian Muresan
Details
updated VDR unit (service file) for systemd (vdr.service,1.08 KB, text/plain)
2014-01-04 00:55 UTC, Lucian Muresan
Details
updated VDR helper script needed by the unit file (vdr-systemd_helper.sh,1.94 KB, application/x-shellscript)
2014-01-04 00:56 UTC, Lucian Muresan
Details
configures user under which to run the VDR daemon (00-gentoo-vdr-user.conf,165 bytes, text/plain)
2014-01-04 01:09 UTC, Lucian Muresan
Details
Ebuild (diff against gentoo-vdr-scripts-2.0.0.ebuild) (gentoo-vdr-scripts-2.0.0.ebuild.diff,1.67 KB, patch)
2014-01-04 01:11 UTC, Lucian Muresan
Details | Diff
configures user under which to run the VDR daemon, can override other unit settings (00-gentoo-vdr-user.conf,219 bytes, text/plain)
2014-01-05 16:54 UTC, Lucian Muresan
Details
updated VDR unit (service file) for systemd (vdr.service,1.13 KB, text/plain)
2014-01-05 16:55 UTC, Lucian Muresan
Details
Ebuild (diff against gentoo-vdr-scripts-2.0.0.ebuild) (gentoo-vdr-scripts-2.0.0.ebuild.diff,1.68 KB, patch)
2014-01-05 16:57 UTC, Lucian Muresan
Details | Diff
Ebuild (diff against gentoo-vdr-scripts-2.0.0.ebuild) (gentoo-vdr-scripts-2.0.0.ebuild.diff,1.68 KB, patch)
2014-01-05 16:59 UTC, Lucian Muresan
Details | Diff
updated VDR helper script needed by the unit file (vdr-systemd_helper.sh,1.96 KB, application/x-shellscript)
2014-01-05 22:33 UTC, Lucian Muresan
Details
updated VDR helper script needed by the unit file (vdr-systemd_helper.sh,2.60 KB, application/x-shellscript)
2014-01-06 23:27 UTC, Lucian Muresan
Details
systemd support fix to 2.5_rc1 (gentoo-vdr-scripts-2.5_rc1-systemd_bugfix.patch,4.09 KB, patch)
2014-10-04 08:10 UTC, Lucian Muresan
Details | Diff
systemd support fix to 2.5_rc2 (gentoo-vdr-scripts-2.5_rc2-systemd_bugfix.patch,692 bytes, patch)
2014-10-19 22:04 UTC, Lucian Muresan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lucian Muresan 2011-02-02 09:06:35 UTC
media-tv/gentoo-vdr-scripts may be used also in conjunction with systemd by keeping the existing config files and scripts architecture based on baselayout / openrc, even if setting up systemd to work with or without any openrc remains.

Reproducible: Always



Expected Results:  
provide necessary systemd unit (service file), possibly depending on USE="systemd" with respective dependency to systemd from the systemd overlay in that case
Comment 1 Lucian Muresan 2011-02-02 09:10:39 UTC
Created attachment 261323 [details]
VDR unit (service file) for systemd

should be installed under /etc/systemd/system for a start, until stable (that's the place where systemd expects user-defined units which take precedence over those in /lib/systemd/system
Comment 2 Lucian Muresan 2011-02-02 09:12:29 UTC
Created attachment 261324 [details]
VDR helper script needed by the unit file

The helper script actually interfaces to the gentoo-vdr-scripts and has to be installed executable under /etc/systemd/scripts (anyway, it has to be called with full path from  the unit file itself)
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-06-17 15:42:40 UTC
I think VDR should start using regular configuration files instead, letting us deprecate the most of gentoo-vdr-scripts.
Comment 4 Pacho Ramos gentoo-dev 2013-07-20 13:14:46 UTC
I will commit in a week if nobody disagrees (also CCing systemd team to let them review the unit files)
Comment 5 Joerg Bornkessel gentoo-dev 2013-07-24 19:21:21 UTC
(In reply to Pacho Ramos from comment #4)
> I will commit in a week if nobody disagrees (also CCing systemd team to let
> them review the unit files)

slowly...

the scripts are untested and written to a personal vdr setup by Lucian

I will add it on weekend and will release a new version of gentoo-vdr-scripts,
yust to bring a little bit moveing in this bug. ;)

Finaly, i think, it needs a little bit more changes in the gentoo-vdr-scripts...

Iam very busy in my Job in the Moment,
after the Sommerbreak, end of September, i will find more time to take a closer look on the systemd crap...
Comment 6 Pacho Ramos gentoo-dev 2013-08-20 08:56:43 UTC
No problem, that is the reason I ask for feedback ;) (that way we can try to cooperate :))
Comment 7 Linus Lotz 2013-10-16 22:27:14 UTC
Is there any progress? I'd like to help.
Comment 8 Lucian Muresan 2014-01-04 00:55:55 UTC
Created attachment 366914 [details]
updated VDR unit (service file) for systemd
Comment 9 Lucian Muresan 2014-01-04 00:56:34 UTC
Created attachment 366916 [details]
updated VDR helper script needed by the unit file
Comment 10 Lucian Muresan 2014-01-04 01:09:06 UTC
Created attachment 366918 [details]
configures user under which to run the VDR daemon

This has to exist when we normally execute the VDR service as user 'vdr'. For the rare, but sometimes necessary case when we want to set RUN_VDR_AS_ROOT in /etc/conf.d/vdr, the 'User=vdr' in this line has to be commented out. A cleaner way may be to obsolete looking at RUN_VDR_AS_ROOT in when executing under systemd, as for OpenRC it seems to be needed. I can't really think that dropping all of the gentoo-vdr-scripts (especially with roughly > 100 media-plugins/vdr-*** which if not all, maybe more than half of them also rely on the scripts to set the initialization parameters) could be an option, despite of some systemd apostles wanting this.
Comment 11 Lucian Muresan 2014-01-04 01:11:04 UTC
Created attachment 366920 [details, diff]
Ebuild (diff against gentoo-vdr-scripts-2.0.0.ebuild)
Comment 12 Lucian Muresan 2014-01-05 16:54:09 UTC
Created attachment 367092 [details]
configures user under which to run the VDR daemon, can override other unit settings

(In reply to Lucian Muresan from comment #10)
[...]
> This has to exist when we normally execute the VDR service as user 'vdr'.
> For the rare, but sometimes necessary case when we want to set
> RUN_VDR_AS_ROOT in /etc/conf.d/vdr, the 'User=vdr' in this line has to be
> commented out.
Reverted the setting in /etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf that it rather should override 'User=vdr' which is the default in vdr.service with 'User=root' in this config file
Comment 13 Lucian Muresan 2014-01-05 16:55:30 UTC
Created attachment 367094 [details]
updated VDR unit (service file) for systemd

The default user is 'vdr', should fit most setups, also updated the path to the helper script
Comment 14 Lucian Muresan 2014-01-05 16:57:18 UTC
Created attachment 367096 [details, diff]
Ebuild (diff against gentoo-vdr-scripts-2.0.0.ebuild)

adjusted systemd helper script path and post-install hint about user setting under which to run the VDR service
Comment 15 Lucian Muresan 2014-01-05 16:59:17 UTC
Created attachment 367100 [details, diff]
Ebuild (diff against gentoo-vdr-scripts-2.0.0.ebuild)

forgot to obsolete old diff
Comment 16 Lucian Muresan 2014-01-05 22:33:41 UTC
Created attachment 367130 [details]
updated VDR helper script needed by the unit file

removed some redundancy
Comment 17 Lucian Muresan 2014-01-06 23:27:38 UTC
Created attachment 367238 [details]
updated VDR helper script needed by the unit file

some more tuning to the script, added some more debug logging to be able to locate which part of the script may have failed
Comment 18 Joerg Bornkessel gentoo-dev 2014-01-19 15:00:04 UTC
added vdr systemd service file
added vdr systemd helper script
to the gentoo-vdr-scripts git

in the moment it is unclear for me, in a systemd less installation, can the systemd service file installed paralell to the existing openrc install without problems/conflicts or should we let the depended systemd files only install if the use-flag systemd is enabled?

ToDo
a better handling for the
/etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf
to grep the USER under where the vdr running
this parameter should be automaticly grepped from the existing gentoo-vdr-scripts without to overload the user with another configurable parameter
Comment 19 Pacho Ramos gentoo-dev 2014-01-19 15:33:29 UTC
All the other packages install systemd files unconditionally, they shouldn't cause any issues (well, I can't think now how they could cause problems :/)
Comment 20 Joerg Bornkessel gentoo-dev 2014-01-20 01:19:09 UTC
iam added a gentoo-vdr-scripts-9999 ebuild in overlay vdr-devel to check out the git repo 
Note: pmasked

for now,
the systemd unit file will be installed per default (thanks Pacho for the hint)
the gentoo-vdr-scripts related systemd files will only installed, if the use-flag systemd is enabled.
i think this is a good solution to prevent the user from unneeded files in the system, if use-flag systemd is disabled

in the next day's i will release a first _beta version of gentoo-vdr-scripts with
systemd support
Comment 21 Pacho Ramos gentoo-dev 2014-01-20 06:59:51 UTC
Well, if unit files will work without that extra files... but if not, you should install all of them unconditionally to not require people to rebuild things only for installing files (a bit like the case of logrorate/bash-completion USE flags removal in the past). If they cause some kind of "collision" with openRC, then it's different of course :)

The idea is to provide both options and, then, people will mostly be able to reboot in either system without much problems
Comment 22 Joerg Bornkessel gentoo-dev 2014-01-20 20:39:47 UTC
(In reply to Pacho Ramos from comment #21)
> Well, if unit files will work without that extra files... but if not, you
> should install all of them unconditionally to not require people to rebuild
> things only for installing files (a bit like the case of
> logrorate/bash-completion USE flags removal in the past). If they cause some
> kind of "collision" with openRC, then it's different of course :)
> 
> The idea is to provide both options and, then, people will mostly be able to
> reboot in either system without much problems

@Pacho
thanks for your review

than it make sense to install all files in paralell mode, without use-flag systemd
I will add/rewrite this in the next hours and let the user test it

@ Lucian

i prefer to install the unit helper script in a own DIR,
eg, /usr/share/vdr/systemd
we dont know yet what we need in the future for changes for systemd support
then all systemd relevanted files are in one directory
also i prefer to split the helper script and make it more modular ( i dont like spagetti_code),
this makes it more readable and debugable
Comment 23 Joerg Bornkessel gentoo-dev 2014-01-21 00:13:21 UTC
done,

all systemd relevanted files will installed per default, without to enable use-flag systemd
Comment 24 Pacho Ramos gentoo-dev 2014-01-21 07:06:53 UTC
Nice, thanks for the work :D
Comment 25 Joerg Bornkessel gentoo-dev 2014-01-26 16:14:23 UTC
last git changes

wrote a proper function to get the user under the vdr systemd run from /etc/conf.d/vdr

and pars the parameter to systemd_env

@ Lucian

please checkout the last git changes
the file /etc/systemd/system/vdr.service.d/*
are now obsolet, you can safely remove it

on my tests, the systemd_env, if not exist, will be created on the fly
so please remove, for testing, the systemd_env, start the vdr on systemd and check
if the systemd_env will be created on the fly with the right permission

also i found out, the parsed parameters in systemd_env VDR_OPTS= includes,
on depending from user settings, the string '--watchdog=60'
on your sugestion it should be '--watchdog=0'

ToDo:
this should also be fixed, overwriting or remove the parameter on start?
also the string '-u' 'vdr' should be removed?
Comment 26 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-26 17:53:43 UTC
Reading /etc/conf.d on systemd is unwanted. Please don't do this, people may want to remove that directory once switched to systemd.
Comment 27 Pacho Ramos gentoo-dev 2014-01-26 22:35:18 UTC
I would use a different file inside /etc/ if some config files can be shared for openrc/systemd
Comment 28 Marc Perrudin 2014-02-05 16:57:28 UTC
The systemd units doesn't work for me. When I try to start vdr, I get :
systemctl status vdr.service -l
vdr.service - Video Disk Recorder Daemon
   Loaded: loaded (/usr/lib/systemd/system/vdr.service; disabled)
   Active: failed (Result: start-limit) since mer. 2014-02-05 17:44:49 CET; 12s ago
  Process: 13512 ExecStartPre=/usr/share/vdr/systemd/vdr-systemd_helper.sh --start-pre (code=exited, status=217/USER)

févr. 05 17:44:49 localhost systemd[1]: Stopping Video Disk Recorder Daemon...
févr. 05 17:44:49 localhost systemd[1]: vdr.service changed auto-restart -> dead
févr. 05 17:44:49 localhost systemd[1]: Job vdr.service/restart finished, result=done
févr. 05 17:44:49 localhost systemd[1]: Converting job vdr.service/restart -> vdr.service/start
févr. 05 17:44:49 localhost systemd[1]: Starting Video Disk Recorder Daemon...
févr. 05 17:44:49 localhost systemd[1]: vdr.service start request repeated too quickly, refusing to start.
févr. 05 17:44:49 localhost systemd[1]: vdr.service changed dead -> failed
févr. 05 17:44:49 localhost systemd[1]: Job vdr.service/start finished, result=failed
févr. 05 17:44:49 localhost systemd[1]: Failed to start Video Disk Recorder Daemon.
févr. 05 17:44:49 localhost systemd[1]: Unit vdr.service entered failed state.


But if I run manually /usr/share/vdr/systemd/vdr-systemd_helper.sh --start-pre
and I launch vdr with the result in /var/vdr/tmp/systemd_env, it works.

Have I missed something ?

Regards.
Comment 29 Joerg Bornkessel gentoo-dev 2014-02-15 19:42:52 UTC
(In reply to Marc Perrudin from comment #28)
> The systemd units doesn't work for me. When I try to start vdr, I get :
> systemctl status vdr.service -l
> vdr.service - Video Disk Recorder Daemon
>    Loaded: loaded (/usr/lib/systemd/system/vdr.service; disabled)
>    Active: failed (Result: start-limit) since mer. 2014-02-05 17:44:49 CET;
> 12s ago
>   Process: 13512 ExecStartPre=/usr/share/vdr/systemd/vdr-systemd_helper.sh
> --start-pre (code=exited, status=217/USER)
> 
> févr. 05 17:44:49 localhost systemd[1]: Stopping Video Disk Recorder
> Daemon...
> févr. 05 17:44:49 localhost systemd[1]: vdr.service changed auto-restart ->
> dead
> févr. 05 17:44:49 localhost systemd[1]: Job vdr.service/restart finished,
> result=done
> févr. 05 17:44:49 localhost systemd[1]: Converting job vdr.service/restart
> -> vdr.service/start
> févr. 05 17:44:49 localhost systemd[1]: Starting Video Disk Recorder
> Daemon...
> févr. 05 17:44:49 localhost systemd[1]: vdr.service start request repeated
> too quickly, refusing to start.
> févr. 05 17:44:49 localhost systemd[1]: vdr.service changed dead -> failed
> févr. 05 17:44:49 localhost systemd[1]: Job vdr.service/start finished,
> result=failed
> févr. 05 17:44:49 localhost systemd[1]: Failed to start Video Disk Recorder
> Daemon.
> févr. 05 17:44:49 localhost systemd[1]: Unit vdr.service entered failed
> state.
> 
> 
> But if I run manually /usr/share/vdr/systemd/vdr-systemd_helper.sh
> --start-pre
> and I launch vdr with the result in /var/vdr/tmp/systemd_env, it works.
> 
> Have I missed something ?
> 
> Regards.

Marc,

please try the latest changes from 15/Feb/2014 20:42 MEZ
Comment 30 Joerg Bornkessel gentoo-dev 2014-09-23 12:01:38 UTC
added gentoo-vdr-scripts-2.5_rc1 to the tree,
it is temp masked, because, in this version are several fixes beside from systemd support,
this need some changes in the existin vdr-*.ebuilds

anyway, it is possible to test it with existing install of vdr
Comment 31 Lucian Muresan 2014-10-04 08:10:19 UTC
Created attachment 386020 [details, diff]
systemd support fix to 2.5_rc1

Hi there,

version 2.5_rc1 broke systemd integration on my system, the attached patch tries to fix this in a way to comply both to vdr scripts and systemd, here some brief explanations:
- in /usr/share/vdr/systemd/vdr-systemd_helper.sh, an early call to init_tmp_dirs was commented out, which led to the env variable PLG_TMP being not defined at invocation time, so the environment file could not be created as user 'vdr' directly in the / root directory;
- in /usr/lib/systemd/system/vdr.service, VDR_OPTS was not properly expanded (single quotes for each plugin parameter missing lead to the vdr startup error that the video directory was not passed, this shows on systemsd where a different directory than /var/vdr/video is used);
- when using with systemd, the user under which vdr runs should be solely handled "rhe systemd way", attached patch to /etc/systemd/system/vdr.service.d/00-gentoo-vdr-user.conf together with the removal of any handling of the START_VDR_AS_ROOT variable, and removing "'-u' 'vdr'" entirely from the startup command line in /usr/share/vdr/systemd/vdr-systemd_helper.sh does exactly this;

Added also some comments in the relevant parts
Comment 32 Joerg Bornkessel gentoo-dev 2014-10-08 13:45:22 UTC
Lucian,

still waiting for your comments,
(remember, never ever i will use systemd to infect my harddisks with this crap, so)
thanks for your help out,... ;)

lucian, after review your patch, do we need the vdr-dbus2vdr plugin in the tree, to complete your request?
Comment 33 Lucian Muresan 2014-10-08 20:33:52 UTC
Hi Joerg,

(In reply to Joerg Bornkessel from comment #32)
> Lucian,
> 
> still waiting for your comments,
> (remember, never ever i will use systemd to infect my harddisks with this
> crap, so)
> thanks for your help out,... ;)

Hehe, I'm using systemd because of sabayon (got some routine on keeping two laptops updated, one of them remote, far away, saves time on updating, therefore I started using sabayon also for the vdr box at some point, few years ago, safely mixing entropy and portage packages. And they threatened for a long time they would no longer support OpenRC in the future, so now it seems it happened...

I'm using vdr under systemd with my latest patch without any issues now, so from my perspective, it should be safe to adopt this latest patch for g-v-s-2.5.
 
> lucian, after review your patch, do we need the vdr-dbus2vdr plugin in the
> tree, to complete your request?

No, it's not needed. I only mentioned that plugin in some commentary in the patch, to warn users who happen to use the plugin already (from whatever source or overlay), or who will eventually use it in the future, that unfortunately the user for the vdr dbus service is configured independently from the setting used for vdr itself, namely in the file /etc/dbus-1/system.d/de.tvdr.vdr.conf. So if someone switches the user vrom "vdr" to "root" or viceversa, (s)he has to do it in 2 places. If you will add the vdr-dbus2vdr plugin to the tree, it might be worth considering to come up with some sed command in the start-pre or start-post pahse of vdr's startup, in common for OpenRC or systemd usage, since the scripts should be able to determine under which user they are started.
Comment 34 Lucian Muresan 2014-10-08 20:40:37 UTC
Sorry, my browser went crazy, did not properly finish the idea. I meant to use sed to also sync the user under which vdr is started at runtime, on startup, by manipulating the file /etc/dbus-1/system.d/de.tvdr.vdr.conf if the vdr-dbus2vdr plugin is installed on the system. That file comes (or should, at least) with this plugin, and it seems that it is queried on initialization of the plugin. Therefore, maybe the start-pre phase of the gentoo-vdr-scripts might be suitable to set the correct user.
Comment 35 Markus Rathgeb 2014-10-14 20:34:30 UTC
Hello!

Could you have a look at what I am missing?

-- Unit vdr.service has begun starting up.
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 87: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 77: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 87: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 87: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 87: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 87: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 87: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: chown: changing ownership of ‘/dev/input/by-path/pci-0000:0b:00.0-event-ir’: Operation not permitted
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 107: /systemd_env: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 108: /systemd_env: Permission denied
Oct 14 22:30:12 mjr-ms vdr-systemd_helper.sh[30330]: /usr/share/vdr/systemd/vdr-systemd_helper.sh: line 87: /vdr-start-log: Permission denied
Oct 14 22:30:12 mjr-ms systemd[1]: vdr.service: control process exited, code=exited status=1
Oct 14 22:30:12 mjr-ms systemd[1]: Failed to start Video Disk Recorder Daemon.

It seems, that PL_TMP is unset.
Comment 36 Markus Rathgeb 2014-10-14 20:38:14 UTC
The line init_tmp_dirs that initialize the variable (...) is comment out.
If I remove the '#' vdr starts.

Is there any reason, why you have comment that line?
Comment 37 Lucian Muresan 2014-10-15 11:23:21 UTC
(In reply to Markus Rathgeb from comment #36)
> The line init_tmp_dirs that initialize the variable (...) is comment out.
> If I remove the '#' vdr starts.
> 
> Is there any reason, why you have comment that line?

@ Markus: don't know why Joerg commented that line out, I had the same problem and addressed it together with some others in the current patch attached to this bug, you might try it out. I hope you did not get that error with my patch applied...
I'd suggest as much as possible persons involved in this bug's conversation try out the current gentoo-vdr-scripts-2.5_rc1 with the attached patch and give feedback to Joerg in this bug report if it is working well or not, also regarding running vdr either as user "root" or as "vdr" under systemd.
It seems Joerg needs the reports of other users who actually have systemd installed and can test, as he is not testing with systemd himself. So positive feedback is also needed, not only problems, even if this is a bug tracker, the bug cannot be closed, and it's over 3 years old :-)
Comment 38 Markus Rathgeb 2014-10-15 13:16:06 UTC
> I'd suggest as much as possible persons involved in this bug's conversation
> try out the current gentoo-vdr-scripts-2.5_rc1 with the attached patch and
> give feedback to Joerg in this bug report if it is working well or not, also
> regarding running vdr either as user "root" or as "vdr" under systemd.
> It seems Joerg needs the reports of other users who actually have systemd
> installed and can test, as he is not testing with systemd himself. So
> positive feedback is also needed, not only problems, even if this is a bug
> tracker, the bug cannot be closed, and it's over 3 years old :-)

There is nothing special about that bug. Normal work flow.
I just did not realize, that the patch you attached is not in tree.
I will apply it and proceed further testing (and report *g*).
Comment 39 Joerg Bornkessel gentoo-dev 2014-10-18 20:00:37 UTC
iam added recently

gentoo-vdr-script-2.5_rc2

with all the changes from Lucians patch

hope this will bring the systemd Nightmare to the end :D
Comment 40 Lucian Muresan 2014-10-19 22:04:11 UTC
Created attachment 386990 [details, diff]
systemd support fix to 2.5_rc2

Hi Joerg,

unfortunately, your change in my patch, in the invocation of VDR_OPTS with {} paranthesae in the unit file broke things for me, the service does not start. You might want to let other users confirm or infirm this - but I expect at most that some would say there is no difference on their system with or without this last change, but for me it is a differnece, see the 2 outputs below, for comparison.

Ah, and one more big wish: please add epatch_user to the ebuild, it makes things easier just like with vdr or plugins as you know...


current result with g-v-s-2.5_rc2  when starting under systemd:

htpc2 tmp # systemctl start vdr.service
Job for vdr.service failed. See 'systemctl status vdr.service' and 'journalctl -xn' for details.
htpc2 tmp # systemctl status vdr.service
vdr.service - Video Disk Recorder Daemon
   Loaded: loaded (/usr/lib64/systemd/system/vdr.service; enabled)
  Drop-In: /etc/systemd/system/vdr.service.d
           └─00-gentoo-vdr-user.conf
   Active: activating (start-post) (Result: exit-code) since Sun 2014-10-19 22:55:33 CEST; 7s ago
  Process: 13340 ExecStopPost=/usr/share/vdr/systemd/vdr-systemd_helper.sh --stop-post (code=exited, status=0/SUCCESS)
  Process: 13305 ExecStop=/usr/share/vdr/systemd/vdr-systemd_helper.sh --stop-pre (code=exited, status=0/SUCCESS)
  Process: 13483 ExecStart=/usr/bin/vdr ${VDR_OPTS} (code=exited, status=2)
  Process: 13358 ExecStartPre=/usr/share/vdr/systemd/vdr-systemd_helper.sh --start-pre (code=exited, status=0/SUCCESS)
 Main PID: 13483 (code=exited, status=2);         : 13484 (vdr-systemd_hel)
   CGroup: /system.slice/vdr.service
           └─control
             ├─13484 /bin/sh /usr/share/vdr/systemd/vdr-systemd_helper.sh --start-post
             └─13550 sleep 1

Oct 19 22:55:33 htpc2 vdr[13483]: vdr: can't access video directory /var/vdr/video



expected result when starting vdr under systemd (also with this latest patch I uploaded now):

htpc2 LC_MESSAGES # systemctl status vdr.service
vdr.service - Video Disk Recorder Daemon
   Loaded: loaded (/usr/lib64/systemd/system/vdr.service; enabled)
  Drop-In: /etc/systemd/system/vdr.service.d
           └─00-gentoo-vdr-user.conf
   Active: active (running) since Sun 2014-10-19 22:57:46 CEST; 5s ago
  Process: 16225 ExecStopPost=/usr/share/vdr/systemd/vdr-systemd_helper.sh --stop-post (code=exited, status=0/SUCCESS)
  Process: 16191 ExecStop=/usr/share/vdr/systemd/vdr-systemd_helper.sh --stop-pre (code=exited, status=0/SUCCESS)
  Process: 16368 ExecStartPost=/usr/share/vdr/systemd/vdr-systemd_helper.sh --start-post (code=exited, status=0/SUCCESS)
  Process: 16243 ExecStartPre=/usr/share/vdr/systemd/vdr-systemd_helper.sh --start-pre (code=exited, status=0/SUCCESS)
 Main PID: 16367 (vdr)
   CGroup: /system.slice/vdr.service
           └─16367 /usr/bin/vdr --userdump --watchdog=0 --epgfile=/var/vdr/tmp/epg.data --cachedir=/var/cache/vdr --log=3 7 --video=/video0 --lirc=/var/run/lirc/lircd --vfat --record=/us...

Oct 19 22:57:47 htpc2 vdr[16367]: [16367] EPGSearch: loading /etc/vdr/plugins/epgsearch/epgsearchdone.data
Oct 19 22:57:47 htpc2 vdr[16367]: [16367] loading /etc/vdr/plugins/epgsearch/timersdone.conf
Oct 19 22:57:47 htpc2 vdr[16367]: [16367] EPGSearch: loading /etc/vdr/plugins/epgsearch/epgsearchupdmail.templ
Oct 19 22:57:47 htpc2 vdr[16367]: [16367] starting plugin: epgsearchonly
Oct 19 22:57:48 htpc2 vdr[16367]: [16367] switching to channel 96
Oct 19 22:57:48 htpc2 vdr[16367]: [16367] ttxtsubs: teletext subtitles replayer started with initial page 000
Oct 19 22:57:48 htpc2 vdr[16367]: INFO: graphlcd: successfully loaded image 'symbols/teletext_small.pbm'
Oct 19 22:57:48 htpc2 vdr[16367]: INFO: graphlcd: successfully loaded image 'symbols/dolby_small.pbm'
Oct 19 22:57:48 htpc2 vdr[16367]: INFO: graphlcd: successfully loaded image 'symbols/scrambled_small.pbm'
Comment 41 Lucian Muresan 2014-10-19 22:09:17 UTC
So it seems that the command line given in ExecStart is somehow misinterpreted when using {} paranthesae for expanding the variable, the result is visible in the fact that vdr does not get any of its arguments. It might be a systemd goodie or feature...
Comment 42 Markus Rathgeb 2014-10-21 19:16:35 UTC
Typo (sytemd -> systemd):
Also please report problems with sytemd on gentoo-vdr-scripts direct in this bug
Comment 43 Joerg Bornkessel gentoo-dev 2014-10-21 21:02:59 UTC
* gentoo-vdr-scripts-2.5_rc3 (21 Oct 2014)

is in the tree, plz resync/emerge in ~15min up from now...


Thx for reporting the typos
Comment 44 Lucian Muresan 2014-10-21 22:37:26 UTC
Hi Joerg, please revise that rc3. It was Markus, not me, who reported the typo, but that's not as bad as leaving my patch (see c#40 and c#41), out ;-)
Comment 45 Joerg Bornkessel gentoo-dev 2014-10-22 11:02:41 UTC
*grmmll*

something goes wrong with the last commit (:

plz upgrade to

* gentoo-vdr-scripts-2.5_rc4

up from now in ~15min
Comment 46 Markus Rathgeb 2014-10-22 20:43:41 UTC
Seems to be working fine.
Thank for your work.
Comment 47 Joerg Bornkessel gentoo-dev 2015-01-01 17:55:08 UTC
gentoo-vdr-scripts-2.5 released 2015/01/01

after any _rc releases, all issues should be fixed now

thx to Lucian, Pacho, Michal, Marcus for a lot of comments, improvments, hints and fixes

if any new issues, plz report it in external bugs