The package vdradmin-am does not include a systemd start script. Here is a very rudimentary starting point: [Unit] Description=Start VDRAdmin After=network.target [Service] Type=forking ExecStart=/bin/su vdradmin -c '/usr/bin/perl /usr/bin/vdradmind --ssl' ExecStop=/bin/su vdradmin -c '/usr/bin/perl /usr/bin/vdradmind -k' PIDFile=/var/run/vdradmin/vdradmind.pid [Install] WantedBy=multi-user.target At the moment it ignores the settings in /etc/conf.d/vdradmin
These lines should be added to create the directories in /var after a reboot: ExecStartPre=/bin/mkdir -p /var/run/vdradmin ExecStartPre=/bin/chown -R vdradmin /var/run/vdradmin ExecStartPre=/bin/mkdir -p /var/log/vdradmin ExecStartPre=/bin/chown -R vdradmin /var/log/vdradmin
+*vdradmin-am-3.6.9-r1 (19 Apr 2014) + + 19 Apr 2014; Pacho Ramos <pacho@gentoo.org> +files/vdradmind.conf, + +files/vdradmind.service, +vdradmin-am-3.6.9-r1.ebuild: + Add unit file (#507736 by Joachim Herb) +
reopended @Pacho thanks for your help out (you are more closed to the systemd crap ;) ) but, to prefer the https://... transmission, it is missed the --ssl parameter for /usr/bin/vdradmind then it should be clear, if systemd is used, use-flag ssl should be enabled by default REQUIRED_USE="systemd? ( ssl )"
(In reply to Joerg Bornkessel from comment #3) > reopended > > @Pacho > thanks for your help out > (you are more closed to the systemd crap ;) ) > > but, > > to prefer the https://... transmission, > it is missed the --ssl parameter for /usr/bin/vdradmind > then it should be clear, if systemd is used, use-flag ssl should be enabled > by default > > REQUIRED_USE="systemd? ( ssl )" I am not sure how vdradmind works: 1. unit file is calling it without "--ssl" option 2. init.d script appends "--ssl" if use uncomments a line in conf.d file If I understand correctly what ebuild is doing with "ssl" USE flag enabled, I would opt by installing a different unit file to run it with "--ssl" option, for that, I think running a "sed" would be enough Do you agree or am I missing something? :/
One could also change the systemd unit file to include EnvironmentFile=/etc/conf.d/vdradmin and modify the start command to ExecStart=/bin/su vdradmin -c "/usr/bin/perl /usr/bin/vdradmind $VDRADMIN_OPTS" and in /etc/conf.d/vdradmin VDRADMIN_OPTS="--ssl" I am not sure, if the same file (/etc/conf.d/vdradmin) should be used for systemd as for OpenRC, or if there is a different place to store config files for systemd (perhaps /etc/sysconfig http://serverfault.com/a/413408)? So here is the file (important is the change of the quotation marks from ' to "): [Unit] Description=Start VDRAdmin After=network.target vdr.service [Service] Type=forking EnvironmentFile=/etc/conf.d/vdradmin ExecStartPre=/bin/mkdir -p /var/run/vdradmin ExecStartPre=/bin/chown -R vdradmin /var/run/vdradmin ExecStartPre=/bin/mkdir -p /var/log/vdradmin ExecStartPre=/bin/chown -R vdradmin /var/log/vdradmin ExecStart=/bin/su vdradmin -c "/usr/bin/perl /usr/bin/vdradmind $VDRADMIN_OPTS" ExecStop=/bin/su vdradmin -c "/usr/bin/perl /usr/bin/vdradmind -k" PIDFile=/var/run/vdradmin/vdradmind.pid [Install] WantedBy=multi-user.target
(In reply to Pacho Ramos from comment #4) > (In reply to Joerg Bornkessel from comment #3) > > reopended > > > > @Pacho > > thanks for your help out > > (you are more closed to the systemd crap ;) ) > > > > but, > > > > to prefer the https://... transmission, > > it is missed the --ssl parameter for /usr/bin/vdradmind > > then it should be clear, if systemd is used, use-flag ssl should be enabled > > by default > > > > REQUIRED_USE="systemd? ( ssl )" > > I am not sure how vdradmind works: > 1. unit file is calling it without "--ssl" option > 2. init.d script appends "--ssl" if use uncomments a line in conf.d file > > If I understand correctly what ebuild is doing with "ssl" USE flag enabled, > I would opt by installing a different unit file to run it with "--ssl" > option, for that, I think running a "sed" would be enough > > Do you agree or am I missing something? :/ Joerg, can you clarify me how this "--ssl" option works and if my guessing about how does it work is ok? (to know if sedding the unit file depending on "ssl" USE would be enough :) Joachim, regarding the policies for unit files, they are a bit explained here: https://wiki.gentoo.org/wiki/Systemd/Ebuild_policy#Unit_file_guidelines Thanks
(In reply to Pacho Ramos from comment #6) > Joachim, regarding the policies for unit files, they are a bit explained > here: > https://wiki.gentoo.org/wiki/Systemd/Ebuild_policy#Unit_file_guidelines Thank you for the link, I didn't know it. So here is a new version of the unit file (no more forking anymore, no config file): [Unit] Description=Start VDRAdmin After=network.target vdr.service [Service] Type=simple ExecStartPre=/bin/mkdir -p /var/run/vdradmin ExecStartPre=/bin/chown -R vdradmin /var/run/vdradmin ExecStartPre=/bin/mkdir -p /var/log/vdradmin ExecStartPre=/bin/chown -R vdradmin /var/log/vdradmin ExecStart=/bin/su vdradmin -c "/usr/bin/perl /usr/bin/vdradmind --nofork --ssl" ExecStop=/bin/su vdradmin -c "/usr/bin/perl /usr/bin/vdradmind -k" PIDFile=/var/run/vdradmin/vdradmind.pid [Install] WantedBy=multi-user.target Here is the help message of vdradmin: Usage /usr/bin/vdradmind [OPTION]... A perl client for the Linux Video Disk Recorder. -n --nofork don't fork -c --config run configuration dialog -d [dir] --cfgdir [dir] use [dir] for configuration files -k --kill kill a forked vdradmind[.pl] -p [name] --pid [name] name of pidfile (ignored with -n) -6 --ipv6 use IPv6 -s --ssl only accept https:// connections -l [level] --log [level] set log level for this session [0 - 7] -L [file] --logfile [file] set log file for this session -h --help this message So --ssl option requires the use to connect via https.
added recently a vdradmind-am-3.6.9-r2.ebuild this will add the needed flags depend on use-flag ssl, ipv6 to the ExecStart=... commandline @Pacho plz recheck for conform systemd syntax @J.Herb plz check for workin state with my changes
(In reply to Joerg Bornkessel from comment #8) > @J.Herb > plz check for workin state with my changes It seems to work. But why is the service file now named vdradmind.service (with "d" at the end)? There seems to be no consistent way to name service files of daemons (e.g. sshd.service: OpenSSH server daemon, but syslog-ng.service System Logger Daemon)
@Pacho on a closer look to your vdradmind.service: it is possible to install vdradmin-am _without_ depend media-video/vdr #wrt bug 171947 (finaly, iam not shure yet, is media-video/vdr really needed in DEPEND) what will the service file do in this case, if vdr not exist? --> After=vdr.service will the start then fails?
(In reply to Joachim Herb from comment #9) > (In reply to Joerg Bornkessel from comment #8) > > @J.Herb > > plz check for workin state with my changes > It seems to work. But why is the service file now named vdradmind.service > (with "d" at the end)? There seems to be no consistent way to name service > files of daemons (e.g. sshd.service: OpenSSH server daemon, but > syslog-ng.service System Logger Daemon) I'd say it'd be best to name the service after the executable it spawns. sshd.service -> /usr/sbin/sshd syslog-ng.service -> /usr/*bin/syslog-ng
(In reply to Joerg Bornkessel from comment #8) > added recently a vdradmind-am-3.6.9-r2.ebuild > > this will add the needed flags depend on use-flag ssl, ipv6 to the > ExecStart=... commandline > > @Pacho > plz recheck for conform systemd syntax > Looks ok to me :) In transmission ebuild I use this sed line to simply append things to the line: # Pass our configuration dir to systemd unit file sed -i '/ExecStart/ s|$| -g /var/lib/transmission/config|' daemon/transmission-daemon.service || die (In reply to Joerg Bornkessel from comment #10) > @Pacho > > on a closer look to your vdradmind.service: > > it is possible to install vdradmin-am _without_ depend media-video/vdr > #wrt bug 171947 > (finaly, iam not shure yet, is media-video/vdr really needed in DEPEND) Does /usr/bin/vdradmind work without vdr be running? In that case simply drop the After line (that is the same as done in init.d files ;))
so, all worrys are gone ;) finaly i droped use-flag vdr vdr from depend after=vdr-servics from service file thx for reporting, testing, ....