Skip to content
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

Noob question about ntp.hosts overriding #25

Open
theo-bittencourt opened this issue Jul 9, 2015 · 13 comments
Open

Noob question about ntp.hosts overriding #25

theo-bittencourt opened this issue Jul 9, 2015 · 13 comments

Comments

@theo-bittencourt
Copy link

Hi!

I'm in Brasil and to reduce the connection lag with ntp servers would be great if I could use my own ntp.hosts files.

There is a recommended way to accomplish that? (I'm using CocoaPods btw)

Great job! Thanks ;)

@theo-bittencourt theo-bittencourt changed the title Noob question about override ntp.hosts file Noob question about ntp.hosts overriding Jul 9, 2015
@gavineadie
Copy link
Collaborator

Feel free to edit your ntp.hosts file to contain the hosts you want.

@theo-bittencourt
Copy link
Author

Hi Gavin!

The problem is when pod is updated (pod update) the changes I did in ntp.hosts will be lost.

@gavineadie
Copy link
Collaborator

Would you want the ntp.hosts removed from the pod? That way it won't get overwritten, but neither will it get added in the first place. If the file is not there, the code deals with that by using a default, built-in list of NTP hosts comprised of the global and continental pools.

I'd be interested in other peoples' thoughts on this to help me decide if this would be OK.

@coffellas-cto
Copy link

I think you can exclude ntp.hosts file from pod if that doesn't break anything in the logic (which should be true taking into consideration your post above). But I suggest to highlight the opportunity of embedding own ntp.hosts in the README file more clearly.

UPD: By the way, adding some text in README that your repo supports CocoaPods would be a perfection :)

@theo-bittencourt
Copy link
Author

Hi @coffellas-cto!

I think if I exclude ntp.hosts from pod, in the next pod update it will be added again. :/

@gavineadie
Copy link
Collaborator

Nobody is asking for ntp.hosts to be kept in the pod, and removing it will not change the behavior of the library, so I will remove it. I will also, as suggested, improve the README remarks related to this file, and to the fact it supports CocoaPods.

I'll report in this thread when these changes are finished ..

@theo-bittencourt
Copy link
Author

It sounds good! ;)

@gavineadie
Copy link
Collaborator

Done .. "ios-ntp 1.1.1" has been pushed. Let me know if this satisfies.

Notes: If you want to use your own ntp.hosts file, put it in your application main bundle. You may have to remove ntp.hosts from the library files yourself the first time, it won't be refreshed by CocoaPods, but I don't know if it'll be removed either.

@theo-bittencourt
Copy link
Author

Worked like a charm. :)

@theo-bittencourt
Copy link
Author

Is not working anymore. :/
In my tests, the network clock is wrong about few minutes.
I have reviewed your commit multiple times and I didn't found anything weird.
Downgrading solve the problem.

@gavineadie
Copy link
Collaborator

Huh?! Is this with a new ntp.hosts file, or the default time servers? If new, what time server? What does the following command show in Terminal (with your hostname obviously) ?

    sntp -d time.apple.com

@theo-bittencourt
Copy link
Author

I tried default servers (removing ntp.hosts) and ntp.hosts with the same value of the old one.
Very weird.

@gavineadie
Copy link
Collaborator

I'm puzzled too. I've also been promising to audit this code and simplify some details for ages, so it seems I must do that soon. I keep starting these improvements and getting distracted by other projects.

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

3 participants