Re: Systemd timers and chrony

Andrei Borzenkov <[email protected]>
Newsgroups gmane.comp.time.chrony.user
Message-ID <CAA91j0VEY2cyOHRq_idLfVkFcyDq1mPLTCZq5X0T8YJsJmoDvw@mail.gmail.com>
On Wed, Mar 23, 2022 at 2:28 PM Krix Rosinski <[email protected]> wrote:
>
> Hello all, thank you for the speedy reply!
>
> @Laura, yes we disable systemd-timesyncd completely and enable chrony instead.
>
> @Kevin, I may ask a separate question there, I thought this will be a common issue for chrony users though.
>
> @Miroslav, timer below, we don't have an RTC, we haven't enabled chrony-wait service yet but we will check if it helps here.
>
> [Unit]
> Description=Daily Timer One Per Day
>
> [Timer]
> OnCalendar=*-*-* 02:10:00
>

Reading systemd.timer man page:

Timer units with at least one OnCalendar= directive acquire a pair of
additional After= [Default] dependencies on time-set.target and
time-sync.target, in order to avoid being started before the system
clock has been correctly set.

And systemd-timesyncd.target will pull in time-set.target:

Wants=time-set.target
Before=time-set.target

chrony-wait.service is also ordered before time-sync.target, so using
it should be equivalent to systemd-timesyncd.service.

> [Install]
> WantedBy=timers.target
>
>
> On Wed, 23 Mar 2022 at 12:18, Miroslav Lichvar <[email protected]> wrote:
>>
>> On Wed, Mar 23, 2022 at 12:09:32PM +0100, Krix Rosinski wrote:
>> > Hello,
>> >
>> > We are trying to set up chrony instead of systemd-timesyncd service,
>> > everything works perfectly except for the systemd timers which fires
>> > straight away when chrony updates time. It seems that systemd-timesyncd
>> > does somethings to temporarily stop timers for time update, and this
>> > doesn't work out of the box with chrony.
>>
>> Can you post an example of the timer which triggers?
>>
>> Does the machine have an RTC?
>>
>> Does it happen when you enable the chrony-wait service?
>>
>> --
>> Miroslav Lichvar
>>
>>
>> --
>> To unsubscribe email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org
>> with "unsubscribe" in the subject.
>> For help email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org
>> with "help" in the subject.
>> Trouble?  Email [email protected]
>>

-- 
To unsubscribe email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "unsubscribe" in the subject.
For help email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "help" in the subject.
Trouble?  Email [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.