Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vi /etc/ntp.conf # Add the line: leapfile /var/lib/ntp/etc/ntp.leapseconds
- update-leap
- service ntpd restart
- less /var/log/ntp # Check for errors
- int main(int argc, char **argv)
- {
- int i, ret;
- ret = get_tai();
- printf("tai offset started at %in", ret);
- if (argc < 2)
- {
- printf("New offset not given, not settingn");
- }
- else
- {
- i = strtol(argv[1],NULL,10);
- printf("Attempting to set TAI offset to %dn",i);
- printf("Checking tai offsets can be properly set: ");
- ret = set_tai(i);
- ret = get_tai();
- if (ret != i) {
- printf("[FAILED] expected: %i got %in", i, ret);
- return EXIT_FAILURE;
- }
- }
- printf("[OK]n");
- return EXIT_SUCCESS;
- }
- TAI_OFFSET=$(grep -v '^#' /usr/share/zoneinfo/leap-seconds.list | tail -1 | awk '{ print $2 }')
- if [ -x /usr/local/sbin/set-tai ]; then
- /usr/local/sbin/set-tai $TAI_OFFSET
- fi
Add Comment
Please, Sign In to add comment