Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-17 Thread Jan Claußen
So I just recompiled the kernel with software interrupts and now chrony does 
successfully set the RTC on my main processor using the rtcfile directive. 
Unfortunately it is also blocking access with timedatectl and hwclock 
meanwhile. Is there a way to still have these commands enabled to read the RTC?

rtcsync still does not work unfortunately on this processor.

Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-17 Thread Jan Claußen
I wanted to say "Just read a bit online and it seems it doesn't support 
interrupts".

On Juli 17 2024, at 1:12 pm, Jan Claußen  wrote:
> > What RTC driver is your machine using? Maybe it doesn't support interrupts.
> It's a DS1307. Just read a bit online. Would software interrupts work as 
> specified in the FAQ?
>
> On Juli 17 2024, at 12:37 pm, Miroslav Lichvar  wrote:
> > On Wed, Jul 17, 2024 at 12:08:26PM +0200, Jan Claußen wrote:
> > > > With rtcdrift you will need to add also
> > > > rtcautotrim to the config or periodically call chronyc trimrtc.
> > > Both of these don't work unfortunately. chronc reports me 513 RTC driver 
> > > not running, although I have everything set.
> > >
> > > I am btw missing an /etc/adjtime file, since our rootfs including /etc is 
> > > read-only. Could that be a problem?
> >
> > No, that could cause only a local/UTC mismatch.
> > What RTC driver is your machine using? Maybe it doesn't support
> > interrupts.
> >
> > --
> > Miroslav Lichvar
> >
> >
> > --
> > To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
> > with "unsubscribe" in the subject.
> > For help email chrony-users-requ...@chrony.tuxfamily.org
> > with "help" in the subject.
> > Trouble? Email listmas...@chrony.tuxfamily.org.
> >
>



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-17 Thread Jan Claußen
> What RTC driver is your machine using? Maybe it doesn't support interrupts.
It's a DS1307. Just read a bit online. Would software interrupts work as 
specified in the FAQ?

On Juli 17 2024, at 12:37 pm, Miroslav Lichvar  wrote:
> On Wed, Jul 17, 2024 at 12:08:26PM +0200, Jan Claußen wrote:
> > > With rtcdrift you will need to add also
> > > rtcautotrim to the config or periodically call chronyc trimrtc.
> > Both of these don't work unfortunately. chronc reports me 513 RTC driver 
> > not running, although I have everything set.
> >
> > I am btw missing an /etc/adjtime file, since our rootfs including /etc is 
> > read-only. Could that be a problem?
>
> No, that could cause only a local/UTC mismatch.
> What RTC driver is your machine using? Maybe it doesn't support
> interrupts.
>
> --
> Miroslav Lichvar
>
>
> --
> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
> with "unsubscribe" in the subject.
> For help email chrony-users-requ...@chrony.tuxfamily.org
> with "help" in the subject.
> Trouble? Email listmas...@chrony.tuxfamily.org.
>



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-17 Thread Miroslav Lichvar
On Wed, Jul 17, 2024 at 12:08:26PM +0200, Jan Claußen wrote:
> > With rtcdrift you will need to add also
> > rtcautotrim to the config or periodically call chronyc trimrtc.
> Both of these don't work unfortunately. chronc reports me 513 RTC driver not 
> running, although I have everything set.
> 
> I am btw missing an /etc/adjtime file, since our rootfs including /etc is 
> read-only. Could that be a problem?

No, that could cause only a local/UTC mismatch.

What RTC driver is your machine using? Maybe it doesn't support
interrupts.

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org 
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org 
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-17 Thread Jan Claußen
> With rtcdrift you will need to add also
> rtcautotrim to the config or periodically call chronyc trimrtc.
Both of these don't work unfortunately. chronc reports me 513 RTC driver not 
running, although I have everything set.

I am btw missing an /etc/adjtime file, since our rootfs including /etc is 
read-only. Could that be a problem?
On Juli 17 2024, at 9:49 am, Miroslav Lichvar  wrote:
> On Tue, Jul 16, 2024 at 03:42:05PM +0200, Jan Claußen wrote:
> > So I found online that an rtcfile directive is needed for the rtcdata 
> > command to work. I am still getting the above error message now. Makes me 
> > wonder if RTC syncing ever worked with the rtcsync directive present. There 
> > was never really a log about chrony syncing to the RTC. I have now tried to 
> > manually set the RTC to a wrong value and have waited more than 11 minutes. 
> > The RTC is still not getting set.
>
> Are you trying that with rtcsync or rtcdrift?
> With rtcsync there are no log messages from chronyd. It's the kernel's
> job to sync the RTC. With rtcdrift you will need to add also
> rtcautotrim to the config or periodically call chronyc trimrtc.
>
> https://chrony-project.org/faq.html#_what_is_the_real_time_clock_rtc
> --
> Miroslav Lichvar
>
>
> --
> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
> with "unsubscribe" in the subject.
> For help email chrony-users-requ...@chrony.tuxfamily.org
> with "help" in the subject.
> Trouble? Email listmas...@chrony.tuxfamily.org.
>



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-17 Thread Jan Claußen
> Are you trying that with rtcsync or rtcdrift?
I am trying with rtcsync. This works on my smaller processor. rtcdrift does not 
work on either processors. No rtc drift file is created, nor is the rtc being 
corrected. I am also getting this error message

Could not enable RTC interrupt : Invalid argument
All of this is pretty much a mystery to me. Writing the clock with hwclock also 
works on the main processor, but not with chronyd.
On Juli 17 2024, at 9:49 am, Miroslav Lichvar  wrote:
> On Tue, Jul 16, 2024 at 03:42:05PM +0200, Jan Claußen wrote:
> > So I found online that an rtcfile directive is needed for the rtcdata 
> > command to work. I am still getting the above error message now. Makes me 
> > wonder if RTC syncing ever worked with the rtcsync directive present. There 
> > was never really a log about chrony syncing to the RTC. I have now tried to 
> > manually set the RTC to a wrong value and have waited more than 11 minutes. 
> > The RTC is still not getting set.
>
> Are you trying that with rtcsync or rtcdrift?
> With rtcsync there are no log messages from chronyd. It's the kernel's
> job to sync the RTC. With rtcdrift you will need to add also
> rtcautotrim to the config or periodically call chronyc trimrtc.
>
> https://chrony-project.org/faq.html#_what_is_the_real_time_clock_rtc
> --
> Miroslav Lichvar
>
>
> --
> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
> with "unsubscribe" in the subject.
> For help email chrony-users-requ...@chrony.tuxfamily.org
> with "help" in the subject.
> Trouble? Email listmas...@chrony.tuxfamily.org.
>



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-17 Thread Miroslav Lichvar
On Tue, Jul 16, 2024 at 03:42:05PM +0200, Jan Claußen wrote:
> So I found online that an rtcfile directive is needed for the rtcdata command 
> to work. I am still getting the above error message now. Makes me wonder if 
> RTC syncing ever worked with the rtcsync directive present. There was never 
> really a log about chrony syncing to the RTC. I have now tried to manually 
> set the RTC to a wrong value and have waited more than 11 minutes. The RTC is 
> still not getting set.

Are you trying that with rtcsync or rtcdrift?

With rtcsync there are no log messages from chronyd. It's the kernel's
job to sync the RTC. With rtcdrift you will need to add also
rtcautotrim to the config or periodically call chronyc trimrtc.

https://chrony-project.org/faq.html#_what_is_the_real_time_clock_rtc

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org 
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org 
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-16 Thread Jan Claußen
So I found online that an rtcfile directive is needed for the rtcdata command 
to work. I am still getting the above error message now. Makes me wonder if RTC 
syncing ever worked with the rtcsync directive present. There was never really 
a log about chrony syncing to the RTC. I have now tried to manually set the RTC 
to a wrong value and have waited more than 11 minutes. The RTC is still not 
getting set.

The relevant kernel modules are present
$ zcat /proc/config.gz | grep CMOS
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_RTC_DRV_CMOS=y

Any idea why this doesn't work?



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-16 Thread Jan Claußen
Thank you for your input! It helped me understand chrony much better. I could 
meanwhile also resolve the issues with some packages not building. Turns out 
those were Yocto-related issues.

> Out of curiosity, which services have a hard dependency on timesyncd?
> Remember that you can override any system provided units by placing
> your replacements in /etc/systemd.
None really has a dependency on it. There was just an issue with the workspaces 
cleanup after I removed it.

I will probably run chrony on both of my processors now as it is more 
configurable. Currently playing around with chronyc a bit and realized that the 
rtcdata command tells me
513 RTC driver not running
I ran the command as root, so no idea what is missing. Here is my config so far
server time1.google.com iburst
server time2.google.com iburst
server time3.google.com iburst
server time4.google.com iburst

makestep 1.0 3
driftfile /var/lib/chrony/drift
rtcsync
allow 192.168.93/24
local stratum 10
Can you spot any errors or something that would need improvement?

Thanks

On Juli 15 2024, at 9:03 am, Miroslav Lichvar  wrote:
> On Fri, Jul 12, 2024 at 01:32:21PM +0200, Jan Claußen wrote:
> > So to not make me suffer more than necessary figuring out how to make all 
> > these other services happy, I would like to ise chrony only as an NTP 
> > server for some other client devices, which are not directly connected to 
> > the internet. This would require me to run timesyncd and chronyd at the 
> > same time. So I would have some questions:
> > Is it problematic to run chrony alongside timesyncd, even when only used as 
> > a server?
>
> Not a problem if chronyd is configured to not touch the system clock,
> only serve time from it. That would mean no sources specified in the
> config, or use the -x option.
>
> But I think you would need to remove the conflict between the two
> services from their systemd unit files and in that case you might just
> as well disable timesyncd and run chronyd as a client.
>
> Generally, it's better to avoid timesyncd:
> https://chrony-project.org/faq.html#_should_i_prefer_chrony_over_timesyncd_if_i_do_not_need_to_run_a_server
>
> --
> Miroslav Lichvar
>
>
> --
> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
> with "unsubscribe" in the subject.
> For help email chrony-users-requ...@chrony.tuxfamily.org
> with "help" in the subject.
> Trouble? Email listmas...@chrony.tuxfamily.org.
>



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-15 Thread Miroslav Lichvar
On Fri, Jul 12, 2024 at 01:32:21PM +0200, Jan Claußen wrote:
> So to not make me suffer more than necessary figuring out how to make all 
> these other services happy, I would like to ise chrony only as an NTP server 
> for some other client devices, which are not directly connected to the 
> internet. This would require me to run timesyncd and chronyd at the same 
> time. So I would have some questions:
> Is it problematic to run chrony alongside timesyncd, even when only used as a 
> server?

Not a problem if chronyd is configured to not touch the system clock,
only serve time from it. That would mean no sources specified in the
config, or use the -x option.

But I think you would need to remove the conflict between the two
services from their systemd unit files and in that case you might just
as well disable timesyncd and run chronyd as a client.

Generally, it's better to avoid timesyncd:
https://chrony-project.org/faq.html#_should_i_prefer_chrony_over_timesyncd_if_i_do_not_need_to_run_a_server

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org 
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org 
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-12 Thread Rob Janssen



On 2024-07-12 13:32, Jan Claußen wrote:
>
> I have some questions about chrony. I am trying to set up chrony as local NTP 
> server. First I tried to completely substitute systemd-timesyncd with chrony, 
> but this turned out as quite the challenge, because at least on a Yocto 
> system some services are dependent on systemd's timesyncd module.

At least on the Debian system that I use, installing the chrony package 
automatically removes the systemd-timesyncd service.
I guess on the Yocto system some package dependencies are incorrectly or not 
very well defined.
Probably there are some services that would require "a timesync mechanism", but 
it should not be hardwired to be systemd-timesync, chrony, or ntpd.

Rob

-- 
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org 
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org 
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-12 Thread Jan Claußen
> Why do application require a specific time synchronisation tool?!
It is not obvious to me either. Neither systemd nor ntpd are listed as 
dependencies. One of the packages failing to build is net-snmp. Might be 
related to system time somehow. systemd is deeply interwoven with the system. 
The timedatectl timesync-status command will start timesyncd which conflicts 
with chrony. It is just hard to get rid of it, although probably not impossible.

> Well, if you cannot change them, maybe you can configure timesyncd to 
> synchronise to localhost?
What do you mean by synchronize to localhost? Unfortunately you can't configure 
timesyncd as thoroughly as chrony. Have not found an option to have it not set 
the RTC or whatever. It is pretty much automated.

On Juli 12 2024, at 2:23 pm, Jan Claußen  wrote:
> > systemd-timesyncd implements SNTP, it periodically updates system
> > time. chronyd will perceive it as erratic time jumps which will
> > probably result in rather bad quality for external clients.
>
> What do you mean by bad quality? I know chrony is supposed to be more 
> correct, but I think the SNTP quality would be enough for my needs. As long 
> as there are no major issues, this would be fine for me.
> > I am not sure what you call a "hardware clock" here. For me RTC *is*
> > hardware clock.
> From my understanding the hardware clock is the RTC as opposed to the system 
> clock which is manged by the kernel in software.
>
> > My understanding is that chronyd will simply get whatever system time there 
> > is.
> This is why I am asking whether it is the hardware clock or system clock. 
> Would be nice if this could be specified the config. It is probably possible
>
> On Juli 12 2024, at 2:06 pm, MUZZULINI Frank  
> wrote:

Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-12 Thread Jan Claußen
> systemd-timesyncd implements SNTP, it periodically updates system
> time. chronyd will perceive it as erratic time jumps which will
> probably result in rather bad quality for external clients.

What do you mean by bad quality? I know chrony is supposed to be more correct, 
but I think the SNTP quality would be enough for my needs. As long as there are 
no major issues, this would be fine for me.
> I am not sure what you call a "hardware clock" here. For me RTC *is*
> hardware clock.
>From my understanding the hardware clock is the RTC as opposed to the system 
>clock which is manged by the kernel in software.

> My understanding is that chronyd will simply get whatever system time there 
> is.
This is why I am asking whether it is the hardware clock or system clock. Would 
be nice if this could be specified the config. It is probably possible

On Juli 12 2024, at 2:06 pm, MUZZULINI Frank  
wrote:

RE: [chrony-users] Chrony and systemd-timesyncd

2024-07-12 Thread MUZZULINI Frank
Hi,

Why do application require a specific time synchronisation tool?!

Well, if you cannot change them, maybe you can configure timesyncd to 
synchronise to localhost?
It may still do random adjustments, but they should be so tiny that they won’t 
do much damage.

Regards,
Frank

From: Jan Claußen 
Sent: Friday, 12 July, 2024 1:32 PM
To: chrony-users@chrony.tuxfamily.org
Subject: [chrony-users] Chrony and systemd-timesyncd

*EXTERNAL source*

Hi,

I have some questions about chrony. I am trying to set up chrony as local NTP 
server. First I tried to completely substitute systemd-timesyncd with chrony, 
but this turned out as quite the challenge, because at least on a Yocto system 
some services are dependent on systemd's timesyncd module.

So to not make me suffer more than necessary figuring out how to make all these 
other services happy, I would like to ise chrony only as an NTP server for some 
other client devices, which are not directly connected to the internet. This 
would require me to run timesyncd and chronyd at the same time. So I would have 
some questions:


  1.  Is it problematic to run chrony alongside timesyncd, even when only used 
as a server?

  1.  How would I accomplish this? 
Online
 it says to use the local directive. I am not entirely sure if chrony syncs 
with the hardware clock here. Since RTCs are said to drift quite a lot, I would 
rather have chrony sync itself with the system clock

  1.  If the hardware clock indeed does sync from the RTC, what is the refclock 
directive needed for? Can I actually use the RTC here is this for another 
purpose?
Thanks



Re: [chrony-users] Chrony and systemd-timesyncd

2024-07-12 Thread Andrei Borzenkov
On Fri, Jul 12, 2024 at 2:32 PM Jan Claußen  wrote:
>
> Hi,
>
> I have some questions about chrony. I am trying to set up chrony as local NTP 
> server. First I tried to completely substitute systemd-timesyncd with chrony, 
> but this turned out as quite the challenge, because at least on a Yocto 
> system some services are dependent on systemd's timesyncd module.
>
> So to not make me suffer more than necessary figuring out how to make all 
> these other services happy, I would like to ise chrony only as an NTP server 
> for some other client devices, which are not directly connected to the 
> internet. This would require me to run timesyncd and chronyd at the same 
> time. So I would have some questions:
>
> Is it problematic to run chrony alongside timesyncd, even when only used as a 
> server?

systemd-timesyncd implements SNTP, it periodically updates system
time. chronyd will perceive it as erratic time jumps which will
probably result in rather bad quality for external clients.

> How would I accomplish this? Online it says to use the local directive. I am 
> not entirely sure if chrony syncs with the hardware clock here. Since RTCs 
> are said to drift quite a lot, I would rather have chrony sync itself with 
> the system clock

My understanding is that chronyd will simply get whatever system time there is.

> If the hardware clock indeed does sync from the RTC, what is the refclock 
> directive needed for? Can I actually use the RTC here is this for another 
> purpose?

I am not sure what you call a "hardware clock" here. For me RTC *is*
hardware clock.

--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.