Re: [chrony-users] Newbie Help Needed |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
An update to my earlier mail, which I now appreciate was low on details.
I added some debug, just printfs, to the chronyd sources...
If I start chronyd with the two 'refclock' lines in /etc/chrony.conf, I
see fds of 3 and 4 for the two sockets, which is fine. 3 is the
'serial' refclock socket and 4 is the 'pps' refclock socket.
Now, in my app, if I ONLY write to the pps socket, chronyd reads 32-byte
samples just fine. But as soon as I write to the serial socket, chronyd
now has a value for that fd not of 3 but of 1076014820. So somewhere
that fd is being corrupted.
I should also point out that if ONLY the serial refclock is defined in
/etc/chrony.conf, then reads from that socket DO work. It is the combo
of the TWO refclocks that is causing the serial refclock to become
corrupted, socket-wise.
I should point also that my target system is a legacy Linux 2.6.10. I
cross-compile for that board from an equally legacy arm-linux-gcc 3.4.0.
I did build chronyd with -Wall added to CFLAGS and didn't see any
warning that might suggest some pointer-to-struct issues.
Confused.
Stuart
On 01/09/2018 11:26 AM, Stuart Maclean wrote:
> Hi Miroslav, folks,
>
> so I ran with your suggested pseudo code and settings for /etc/chrony.conf:
>
>>
>> refclock SOCK /var/run/chrony.serial.sock refid CSAC noselect
>> refclock SOCK /var/run/chrony.pps.sock refid PPS lock CSAC
>>
>
> I started chronyd thus:
>
> $ sudo ./chronyd -d
>
> since I wanted to monitor any messages at the terminal.
>
> 2018-01-09T19:17:04Z chronyd version 2.3 starting (+CMDMON +NTP
> +REFCLOCK -RTC -PRIVDROP -SCFILTER )
>
> I then started, from a second terminal on my target system (an arm5
> board), my own app which does the send() calls you had suggested.
>
> Somewhat bizarrely, chronyd is complaining about the incoming data:
>
> 2018-01-09T19:17:44Z Could not read SOCK sample : Bad file descriptor
>
> and this line repeats at a very high rate until I have to kill chronyd.
>
> I can see in the sources that this is from routine read_sample in
> refclock_sock.c. This is an I/O error, i.e. is occuring before the
> contents of any data is even checked.
>
> I am at a loss as to what exactly I did wrong.
>
> Stuart
>
--
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.