Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 471310 - net-dns/ddclient please add systemd unit
Summary: net-dns/ddclient please add systemd unit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Aaron W. Swenson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-05-26 07:50 UTC by Agostino Sarubbo
Modified: 2013-08-31 06:42 UTC (History)
1 user (show)

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


Attachments
ddclient.service (ddclient.service,321 bytes, text/plain)
2013-07-28 19:33 UTC, nE0sIghT
Details
ddclient.conf - tmpfiles.d config (ddclient.conf,41 bytes, text/plain)
2013-07-28 19:33 UTC, nE0sIghT
Details
patch against ddclient-3.8.1-r4.ebuild (ddclient-3.8.1-r5.patch,607 bytes, patch)
2013-07-28 19:35 UTC, nE0sIghT
Details | Diff
ddclient.service (ddclient.service,301 bytes, text/plain)
2013-07-28 20:42 UTC, nE0sIghT
Details
ddclient.service (ddclient.service,234 bytes, text/plain)
2013-08-20 13:35 UTC, nE0sIghT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2013-05-26 07:50:03 UTC
$summary
Comment 1 Pacho Ramos gentoo-dev 2013-07-20 13:30:53 UTC
Would be nice to attach one working for you :)
Comment 3 nE0sIghT 2013-07-28 19:33:03 UTC
Created attachment 354428 [details]
ddclient.service

Here is unit file that have more stuff from openrc init.d file:
1. It starts before cron. For this feature to work all systemd units of cron implementations (like fcron) must define "Alias=cron.service" under Install section
2. It checking for /etc/ddclient/ddclient.conf presense
3. It starts ddclient under ddclient user/group
Comment 4 nE0sIghT 2013-07-28 19:33:41 UTC
Created attachment 354430 [details]
ddclient.conf - tmpfiles.d config
Comment 5 nE0sIghT 2013-07-28 19:35:44 UTC
Created attachment 354436 [details, diff]
patch against ddclient-3.8.1-r4.ebuild
Comment 6 Pacho Ramos gentoo-dev 2013-07-28 19:54:07 UTC
Why does it need to be started before cron?
Comment 7 nE0sIghT 2013-07-28 20:35:48 UTC
No idea
It's from that bug: https://bugs.gentoo.org/show_bug.cgi?id=117124#c60

''Added "before cron" and "use dns logger", as in /etc/init.d/ntp-client"''
Comment 8 nE0sIghT 2013-07-28 20:42:10 UTC
Created attachment 354446 [details]
ddclient.service

For ntp-client "before cron" cause is here: https://bugs.gentoo.org/show_bug.cgi?id=26716
Useless for ddclient

Here is updated unit
Comment 9 Pacho Ramos gentoo-dev 2013-07-28 20:58:43 UTC
OK, thanks

One more note, why don't you replace second pidfile path by "${PIDFILE}" you are setting in the above line?
Comment 10 nE0sIghT 2013-07-29 03:24:24 UTC
As i know it will not work such way
We can use "EnvironmentFile=/etc/conf.d/ddclient" to obtain this variable, but i think it must not be configurable
Comment 11 Pacho Ramos gentoo-dev 2013-07-29 19:39:39 UTC
I see some units in /usr/lib/systemd/system using "MAINPID" for similar purposes, not sure if it could be used for this
Comment 12 nE0sIghT 2013-07-29 19:47:03 UTC
If i understand properly systemd.service(5) $MAINPID is only for ExecReload= and ExecStop= parameters.
Comment 13 Pacho Ramos gentoo-dev 2013-08-20 09:18:37 UTC
I will review, test and commit it in a week if nobody disagrees. Thanks

Anyway, reading arch unit file, probably setting PIDFile is enough and, then, "-p" option (and the repetition of PIDFile path) could be dropped
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-08-20 09:37:21 UTC
How about just '--foreground'?
Comment 15 nE0sIghT 2013-08-20 13:35:18 UTC
Created attachment 356488 [details]
ddclient.service

Yes, i think --foreground is good solution
Comment 16 Pacho Ramos gentoo-dev 2013-08-20 17:09:28 UTC
(In reply to nE0sIghT from comment #15)
> Created attachment 356488 [details]
> ddclient.service
> 
> Yes, i think --foreground is good solution

Doesn't it need to specify "Type"? (I cannot see what is the default value of "Type" when it's unset in "man systemd.service" :S)
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-08-20 17:37:47 UTC
(In reply to Pacho Ramos from comment #16)
> (In reply to nE0sIghT from comment #15)
> > Created attachment 356488 [details]
> > ddclient.service
> > 
> > Yes, i think --foreground is good solution
> 
> Doesn't it need to specify "Type"? (I cannot see what is the default value
> of "Type" when it's unset in "man systemd.service" :S)

second paragraph:

  If set to simple (the default value if BusName= is not specified) ...
Comment 18 Pacho Ramos gentoo-dev 2013-08-31 06:42:46 UTC
+*ddclient-3.8.1-r5 (31 Aug 2013)
+
+  31 Aug 2013; Pacho Ramos <pacho@gentoo.org> +ddclient-3.8.1-r5.ebuild,
+  +files/ddclient.service:
+  Add unit file (#471310 by nE0sIghT and Ago)
+