[systemd-devel] time-sync.target
Pietro Paolini
pietro.paolini at ocado.com
Wed May 31 08:33:09 UTC 2017
On 31 May 2017 at 02:36, Luke Shumaker <lukeshu at lukeshu.com> wrote:
> On Tue, 30 May 2017 11:57:00 -0400,
> Pietro Paolini wrote:
> > Hi everybody,
> >
> > I am trying to configure my systemd to run my service *after* the
> > timesyncd service is synchronized with the NTP server, unfortunately
> > adding the "After=time-sycd.target" does not work as I can't see any
> > change in the behavior - my service is started immediately anyway.
> >
> > Reading here https://github.com/systemd/systemd/issues/5097 it looks
> > like there is a problem with that target but I am not sure where to
> > start from, is it feasible to patch the systemd-timesyncd daemon to
> > correct the behavior ?
>
> Yes, this is a problem with timesyncd, and it should eventually be
> patched.
>
> The problem with patching it is that without re-thinking something, it
> is impossible to have it block time-sync.target without also risking
> systemd-timesyncd.service from timing out.
>
> The only solution that I can think of is to have a second helper
> process that can't time out that waits for a signal from timesyncd;
> and have that process block time-sync.target. But, the systemd team
> hasn't yet decided if this solution is acceptable to them.
>
> So, anyway, I went ahead wrote such a helper program, and a wrapper
> for timesyncd that handles sending the signal.
>
> > As alternative I could write my wrapper around the daemon as done in
> > the link reporting the issue, both ways I will need to read
> > something enlightening on the matter, would you be able to point me
> > into the right direction ?
>
> >You should be able to install and use the wrapper that I wrote.
> >There's nothing specific to my use-case about it. If you install it,
> >then the "time-sync.target" should "just work" correctly with
> >timesyncd.
>
> >Of course, in the long-term it would be preferable to patch timesyncd,
> >instead of having to install separate wrapper to fix the behavior.
> >But for today, it works.
>
> Thanks! Unfortunately it is not an option to install the Go runtime system
on the board I am working with, is there a place where I can find docs
about writing my own wrapper in C ?
Cheers,
Pietro
> --
> Happy hacking,
> ~ Luke Shumaker
>
--
Notice: This email is confidential and may contain copyright material of
members of the Ocado Group. Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the members of the
Ocado Group.
If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.
Fetch and Sizzle are trading names of Speciality Stores Limited and Fabled
is a trading name of Marie Claire Beauty Limited, both members of the Ocado
Group.
References to the “Ocado Group” are to Ocado Group plc (registered in
England and Wales with number 7098618) and its subsidiary undertakings (as
that expression is defined in the Companies Act 2006) from time to time.
The registered office of Ocado Group plc is Buildings One & Two, Trident
Place, Mosquito Way, Hatfield, Hertfordshire, AL10 9UL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170531/4391ce5c/attachment.html>
More information about the systemd-devel
mailing list