Re: Chrony not taking SOCKET data from Application

sarveshwar k <[email protected]>
Newsgroups gmane.comp.time.chrony.user
Message-ID <CAAik_WyNqB=Ck0EUZVGF3Sj_n5pprWhNZCPT-QjqqQDbS0sVAw@mail.gmail.com>
Hi Miroslav Lichvar,

I have enabled debug option as suggested. I am trying to send the data of
GPS time as per the structure mentioned below in refclock_sock.c file:



















*struct sock_sample {  /* Time of the measurement (system time) */  struct
timeval tv;  /* Offset between the true time and the system time (in
seconds) */  double offset;  /* Non-zero if the sample is from a PPS
signal, i.e. another source     is needed to obtain seconds */  int pulse;
/* 0 - normal, 1 - insert leap second, 2 - delete leap second */  int
leap;  /* Padding, ignored */  int _pad;  /* Protocol identifier
(0x534f434b) */  int magic;};*

But I see the data is not received at all. I expected read_sample()
function will be triggered when received on the socket. But I am seeing
error message from file cmdmon.c file mentioning "Read command packet
without the source address". I am using Unix Domain socket with SOCK_DGRAM
option.

Please suggest how to resolve this issue and how to format the data to
chrony from an application.

Thanks & Regards
Sarveshwar.K

On Thu, Jan 19, 2023 at 2:52 PM Miroslav Lichvar <[email protected]>
wrote:

> On Thu, Jan 19, 2023 at 09:13:28AM +0530, sarveshwar k wrote:
> > chronyd.sock was created under /var/run/chrony when I run chronyd. I
> wrote
> > an application using unix domain socket and connected to socket and
> > sent GPS UTC time in the required format accepted by chronyd.
> >
> > But I dont see chronyd taking this time as I see #? for SOCK and PPS
> > reference clocks.
>
> Build chrony with the --enable-debug option and then run chronyd with
> -d -d to see the debug messages. There should be a message with some
> information what it doesn't like about the SOCK sample. Usually it's
> the sample "age", coming from the SOCK tv field. It needs to be the
> system time, not the reference time.
>
> --
> 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]
>
>
c1.log (application/octet-stream, 10.6 KB)
2023-01-18T00:33:05Z main.c:511:(main) chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 +DEBUG)
2023-01-18T00:33:05Z conf.c:412:(CNF_ReadFile) Reading /etc/chrony.conf
2023-01-18T00:33:05Z util.c:1270:(UTI_OpenFile) Opened /var/run/chrony/chronyd.pid fd=3 mode=W
2023-01-18T00:33:05Z local.c:149:(calculate_sys_precision) Clock precision 0.000000180 (-22)
2023-01-18T00:33:05Z sys_linux.c:308:(get_version_specific_details) Linux kernel major=5 minor=4 patch=69
2023-01-18T00:33:05Z sys_linux.c:334:(get_version_specific_details) hz=100 nominal_tick=10000 max_tick_bias=1000 tick_update_hz=100000
2023-01-18T00:33:06Z local.c:663:(lcl_RegisterSystemDrivers) Local freq=100000.000ppm
2023-01-18T00:33:06Z refclock.c:240:(RCL_AddRefclock) Setting filter length for PPS0 to 1
2023-01-18T00:33:06Z refclock.c:259:(RCL_AddRefclock) refclock PPS refid=PPS0 poll=0 dpoll=0 filter=1
2023-01-18T00:33:06Z refclock.c:259:(RCL_AddRefclock) refclock SOCK refid=GPS poll=4 dpoll=0 filter=64
2023-01-18T00:33:06Z reference.c:224:(REF_Initialise) Initial frequency 100000.000 ppm
2023-01-18T00:33:06Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:06Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:07Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:09Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:10Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:11Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:12Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:13Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:14Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:15Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:16Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:17Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:18Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:19Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:20Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:21Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:22Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:23Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:57Z sched.c:695:(check_current_time) Forward time jump detected!
2023-01-18T00:33:57Z sys_generic.c:249:(update_slew) slew offset=0.000000e+00 corr_rate=0.000000e+00 base_freq=100000.000000 total_freq=100000.000000 slew_freq=0.000000e+00 duration=10000.000000 slew_error=0.000000e+00
2023-01-18T00:33:57Z sources.c:773:(SRC_SelectSource) badstat=1 sel=0 badstat_reach=0 sel_reach=0 size=0 max_reach_ago=0.000000
2023-01-18T00:33:57Z refclock.c:646:(valid_sample_time) PPS0 refclock sample time 1674002003.707129941 not valid age=33.585479
2023-01-18T00:33:57Z cmdmon.c:1294:(read_from_cmd_socket) Read command packet without source address
2023-01-18T00:33:58Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:33:59Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:00Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:01Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:02Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:02Z cmdmon.c:1329:(read_from_cmd_socket) Received 32 bytes from /var/run/chrony/chronyc.1625.sock fd 8
2023-01-18T00:34:02Z cmdmon.c:407:(transmit_reply) Sent 32 bytes to /var/run/chrony/chronyc.1625.sock fd 8
2023-01-18T00:34:02Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1625.sock fd 8
2023-01-18T00:34:02Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1625.sock fd 8
2023-01-18T00:34:02Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1625.sock fd 8
2023-01-18T00:34:02Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1625.sock fd 8
2023-01-18T00:34:03Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:04Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:05Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:06Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:06Z cmdmon.c:1329:(read_from_cmd_socket) Received 32 bytes from /var/run/chrony/chronyc.1638.sock fd 8
2023-01-18T00:34:06Z cmdmon.c:407:(transmit_reply) Sent 32 bytes to /var/run/chrony/chronyc.1638.sock fd 8
2023-01-18T00:34:06Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1638.sock fd 8
2023-01-18T00:34:06Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1638.sock fd 8
2023-01-18T00:34:06Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1638.sock fd 8
2023-01-18T00:34:06Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1638.sock fd 8
2023-01-18T00:34:07Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:08Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:08Z cmdmon.c:1329:(read_from_cmd_socket) Received 32 bytes from /var/run/chrony/chronyc.1645.sock fd 8
2023-01-18T00:34:08Z cmdmon.c:407:(transmit_reply) Sent 32 bytes to /var/run/chrony/chronyc.1645.sock fd 8
2023-01-18T00:34:08Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1645.sock fd 8
2023-01-18T00:34:08Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1645.sock fd 8
2023-01-18T00:34:08Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1645.sock fd 8
2023-01-18T00:34:08Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1645.sock fd 8
2023-01-18T00:34:09Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:10Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:10Z cmdmon.c:1329:(read_from_cmd_socket) Received 32 bytes from /var/run/chrony/chronyc.1652.sock fd 8
2023-01-18T00:34:10Z cmdmon.c:407:(transmit_reply) Sent 32 bytes to /var/run/chrony/chronyc.1652.sock fd 8
2023-01-18T00:34:10Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1652.sock fd 8
2023-01-18T00:34:10Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1652.sock fd 8
2023-01-18T00:34:10Z cmdmon.c:1329:(read_from_cmd_socket) Received 76 bytes from /var/run/chrony/chronyc.1652.sock fd 8
2023-01-18T00:34:10Z cmdmon.c:407:(transmit_reply) Sent 76 bytes to /var/run/chrony/chronyc.1652.sock fd 8
2023-01-18T00:34:11Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:12Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:13Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:14Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:15Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:16Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:17Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:18Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:19Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:20Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:21Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:22Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:23Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:24Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:25Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:26Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:27Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:28Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:29Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:30Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:31Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:32Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:33Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:34Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:35Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:36Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:37Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:38Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:39Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:40Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:41Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:42Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:43Z refclock.c:548:(RCL_AddCookedPulse) refclock pulse ignored no ref sample
2023-01-18T00:34:44Z main.c:612:(main) chronyd exiting
2023-01-18T00:34:44Z reference.c:353:(update_drift_file) Could not open temporary driftfile /var/lib/chrony/drift.tmp for writing
chrony /var/run/chrony/chronyd.sock
socket initialize
Instance 4
In File handler
In File handler
In File handler
In File handler
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.