$summary
Would be nice to attach one working for you :)
Maybe arch one could be used: https://projects.archlinux.org/svntogit/community.git/tree/trunk/ddclient.service?h=packages/ddclient
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
Created attachment 354430 [details] ddclient.conf - tmpfiles.d config
Created attachment 354436 [details, diff] patch against ddclient-3.8.1-r4.ebuild
Why does it need to be started before cron?
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"''
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
OK, thanks One more note, why don't you replace second pidfile path by "${PIDFILE}" you are setting in the above line?
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
I see some units in /usr/lib/systemd/system using "MAINPID" for similar purposes, not sure if it could be used for this
If i understand properly systemd.service(5) $MAINPID is only for ExecReload= and ExecStop= parameters.
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
How about just '--foreground'?
Created attachment 356488 [details] ddclient.service Yes, i think --foreground is good solution
(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)
(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) ...
+*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) +