Skip to content

.netrc settings not work properly using ntpq or ntpdc binary #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pilebones opened this issue Apr 9, 2018 · 0 comments
Open

.netrc settings not work properly using ntpq or ntpdc binary #26

pilebones opened this issue Apr 9, 2018 · 0 comments

Comments

@pilebones
Copy link

In my case NTPd runnning inside a container, so I want to change the default host target used by ntpq -p and ntpdc -p command (default: 127.0.0.1). I have created ~/.ntprc with the following content:

[NTPQ]
command host 169.254.0.10
 
[NTPDC]
command host 169.254.0.10

But when I'm running command I have an error occured which display an unknown random command like below:

ntpq -p
***Command `���.'' unknown
current host set to 169.254.0.10
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*LOCAL(0)        .LOCL.          14 l   63   64  377    0.000    0.000   0.000
ntpq -p
***Command `����*' unknown
current host set to 169.254.0.10
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*LOCAL(0)        .LOCL.          14 l   51   64  377    0.000    0.000   0.000

In some case the command work as expected :

ntpq -p
current host set to 169.254.0.10
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*LOCAL(0)        .LOCL.          14 l   43   64  377    0.000    0.000   0.000

It looks like a misread buffer error.

Besides, the manual is not really clear about the preset mechanisms using environment variables named NTPQ_* inside .netrc. I tried to set host using NTPQ_HOST=<ip> or host <ip> but none of these trials works.

How can I change the default host without define the host ip for each command (ie: ntpq -p <ip>) ?
I use ntpq in version [email protected].

Thanks for your feedbacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant