Skip to content

Check either ntpdate command exists or not before trying to execute it

Alexander Kutelev requested to merge kutelev/gitlab-runner:sntp into master

What does this MR do?

This MR is successor of the !1145 (merged) MR which fixed #3666 (closed) issue.

Original fix has a minor flaw, it tries to execute ntpdate many times before switching to sntp. As result job execution delay is introduced.

This MR improves the situation. Instead of trying to execute ntpdate command it is suggested to check either this command exists or not, if it does not exist we immediately switch to sntp.

The fix has been tested with the following guest OSes:

  1. Mavericks (10.9)
  2. Sierra (10.12)
  3. Mojave (10.14)

Why was this MR needed?

Without these changes the Runner spends at least 20 seconds on useless spinning trying to execute non-existing ntpdate command on Mojave and newer macOS versions.

Are there points in the code the reviewer needs to double check?

-

Does this MR meet the acceptance criteria?

  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

#3666 (closed)

Edited by Alexander Kutelev

Merge request reports