答复: [chrony-users] how to get the status of chronyd in namespace

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]



-----邮件原件-----
发件人: Miroslav Lichvar [mailto:mlichvar@xxxxxxxxxx] 
发送时间: 2022年11月23日 16:22
收件人: chrony-users@xxxxxxxxxxxxxxxxxxxx
主题: Re: [chrony-users] how to get the status of chronyd in namespace

On Wed, Nov 23, 2022 at 03:16:35AM +0000, chengyechun wrote:
> Hi all
> I am using the chronyd service, but I put the service in the namespace for isolation, and then synchronize other servers. I find that the synchronization status of the chronyd in the namespace cannot be queried through chronyc. What can I do?

Is it a networking namespace? To access the UDP sockets you would need to use "ip netns exec $NAMESPACE chronyc".
Yes, I tried this command, but it didn't seem to work; If there are multiple namespaces, the client and server are deployed on the same host, as shown in the following figure.

[root@localhost ETS]# ps -ef | grep chrony
chrony    947343       1  0 16:34 ?        00:00:00 /usr/sbin/chronyd -f /etc/chrony.conf.tmp1
chrony    947370       1  0 16:34 ?        00:00:00 /usr/sbin/chronyd -f /etc/chrony.conf.tmp2
chrony    947397       1  0 16:34 ?        00:00:00 /usr/sbin/chronyd -f /etc/chrony.conf.tmp3
chrony    947428       1  0 16:34 ?        00:00:00 /usr/sbin/chronyd -f /etc/chrony.conf.tmp4
chrony    947429  947428  0 16:34 ?        00:00:00 /usr/sbin/chronyd -f /etc/chrony.conf.tmp4
root      951981   53788  0 16:41 pts/1    00:00:00 grep --color=auto chrony
[root@localhost ETS]# ip netns exec net1 chronyc sources -a -v

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current best, '+' = combined, '-' = not combined,
| /             'x' = may be in error, '~' = too variable, '?' = unusable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================

If you can access the Unix socket, that shouldn't be necessary.
How do you use this?
--
Miroslav Lichvar


-- 
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.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/