Guest User

Untitled

a guest
Jan 24th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. vi /etc/ntp.conf # Add the line: leapfile /var/lib/ntp/etc/ntp.leapseconds
  2. update-leap
  3. service ntpd restart
  4. less /var/log/ntp # Check for errors
  5.  
  6. int main(int argc, char **argv)
  7. {
  8. int i, ret;
  9.  
  10. ret = get_tai();
  11. printf("tai offset started at %in", ret);
  12.  
  13. if (argc < 2)
  14. {
  15. printf("New offset not given, not settingn");
  16. }
  17. else
  18. {
  19. i = strtol(argv[1],NULL,10);
  20. printf("Attempting to set TAI offset to %dn",i);
  21. printf("Checking tai offsets can be properly set: ");
  22. ret = set_tai(i);
  23. ret = get_tai();
  24. if (ret != i) {
  25. printf("[FAILED] expected: %i got %in", i, ret);
  26. return EXIT_FAILURE;
  27. }
  28. }
  29. printf("[OK]n");
  30. return EXIT_SUCCESS;
  31. }
  32.  
  33. TAI_OFFSET=$(grep -v '^#' /usr/share/zoneinfo/leap-seconds.list | tail -1 | awk '{ print $2 }')
  34. if [ -x /usr/local/sbin/set-tai ]; then
  35. /usr/local/sbin/set-tai $TAI_OFFSET
  36. fi
Add Comment
Please, Sign In to add comment