1 00:00:06,630 --> 00:00:07,710 - All right. 2 00:00:07,710 --> 00:00:11,010 In Linux time, time synchronization is pretty important. 3 00:00:11,010 --> 00:00:12,900 So how does that work? 4 00:00:12,900 --> 00:00:16,560 Well, to start with use timedatectl set-ntp 5 00:00:16,560 --> 00:00:19,830 which enables or disables time synchronization. 6 00:00:19,830 --> 00:00:21,630 That should be on by default. 7 00:00:21,630 --> 00:00:23,610 Timedatectl timesync-status 8 00:00:23,610 --> 00:00:26,460 will show you timesync-status information. 9 00:00:26,460 --> 00:00:28,770 And if you want more detail 10 00:00:28,770 --> 00:00:31,200 on a system that is using the chrony service 11 00:00:31,200 --> 00:00:32,790 which is the case for Red Hat, 12 00:00:32,790 --> 00:00:36,510 you can use chronyc sources and chronyc tracking. 13 00:00:36,510 --> 00:00:39,450 For much and really, much more information 14 00:00:39,450 --> 00:00:42,180 about time synchronization and the current status. 15 00:00:42,180 --> 00:00:43,443 Let's go check this out. 16 00:00:46,410 --> 00:00:51,337 So to start with sudo timedatectl 17 00:00:51,337 --> 00:00:53,850 timesync-status 18 00:00:53,850 --> 00:00:55,020 is showing us, 19 00:00:55,020 --> 00:00:57,283 oh the name is not activatable. 20 00:00:58,170 --> 00:01:00,570 Activatable, what does that mean? 21 00:01:00,570 --> 00:01:02,760 Well, let's further investigate. 22 00:01:02,760 --> 00:01:06,543 I am going to use timedatectl set, 23 00:01:07,710 --> 00:01:09,480 timedatectl status, 24 00:01:09,480 --> 00:01:10,800 and there we can see 25 00:01:10,800 --> 00:01:13,680 NTP service: active 26 00:01:13,680 --> 00:01:15,690 and system clock synchronized. 27 00:01:15,690 --> 00:01:17,580 So all of that is looking good. 28 00:01:17,580 --> 00:01:19,080 Now as this timedatectl 29 00:01:19,080 --> 00:01:22,110 timesync status is giving some weird message. 30 00:01:22,110 --> 00:01:23,970 I want to further investigate. 31 00:01:23,970 --> 00:01:26,691 So sudo chrony, 32 00:01:26,691 --> 00:01:28,950 chronyc sources 33 00:01:28,950 --> 00:01:30,540 is what we are going to use. 34 00:01:30,540 --> 00:01:31,650 And this is showing 35 00:01:31,650 --> 00:01:34,530 the time sources that are actually being used. 36 00:01:34,530 --> 00:01:35,970 And you know what's going on. 37 00:01:35,970 --> 00:01:38,190 I think I understand what's going on. 38 00:01:38,190 --> 00:01:40,900 If you use sudo systemctl 39 00:01:41,910 --> 00:01:43,000 status 40 00:01:44,640 --> 00:01:46,560 chrony, chronyd 41 00:01:46,560 --> 00:01:49,530 then we can see that chronyd service is running. 42 00:01:49,530 --> 00:01:51,690 Now it happens to be that nowadays in Linux, 43 00:01:51,690 --> 00:01:53,910 there are two different services that can be used 44 00:01:53,910 --> 00:01:55,830 for time synchronization. 45 00:01:55,830 --> 00:01:59,122 It's either chrony or systemd-timesyncd 46 00:01:59,122 --> 00:02:01,680 Systemd-timesyncd is pretty simple. 47 00:02:01,680 --> 00:02:04,710 And for that reason, you won't find it always active. 48 00:02:04,710 --> 00:02:07,110 And here on my Red Hat family system. 49 00:02:07,110 --> 00:02:09,360 I can see chronyd service. 50 00:02:09,360 --> 00:02:12,900 And that's why timedatectl timesync-status 51 00:02:12,900 --> 00:02:15,990 is giving me, a service is not activatable 52 00:02:15,990 --> 00:02:17,867 that's because it has been blocked out by chrony. 53 00:02:17,867 --> 00:02:21,270 Chrony is doing the work and chronyc sources, 54 00:02:21,270 --> 00:02:22,470 as we can see here, 55 00:02:22,470 --> 00:02:25,590 is showing all the time synchronization sources, 56 00:02:25,590 --> 00:02:27,450 including the stratum. 57 00:02:27,450 --> 00:02:30,510 So that's a reliability, as we have just seen, 58 00:02:30,510 --> 00:02:32,130 including 59 00:02:32,130 --> 00:02:34,590 the offset in milliseconds, 60 00:02:34,590 --> 00:02:38,640 that falls far within the 1000 seconds 61 00:02:38,640 --> 00:02:40,680 limit that is allowed. 62 00:02:40,680 --> 00:02:42,480 Now, if this is not enough detail 63 00:02:42,480 --> 00:02:46,037 use sudo chrony, 64 00:02:47,847 --> 00:02:50,190 sudo chronyc tracking. 65 00:02:50,190 --> 00:02:52,800 And what is chronyc tracking giving you? 66 00:02:52,800 --> 00:02:55,140 That is giving you even more detail 67 00:02:55,140 --> 00:03:00,140 about the current time sync status. 68 00:03:00,180 --> 00:03:02,850 For most people this is too much information. 69 00:03:02,850 --> 00:03:05,820 Chronyc sources is more than enough. 70 00:03:05,820 --> 00:03:07,650 It shows you the time sync sources 71 00:03:07,650 --> 00:03:09,900 and it's giving you the comfortable feeling 72 00:03:09,900 --> 00:03:11,340 that you are okay. 73 00:03:11,340 --> 00:03:14,250 But if you need more detail, here you go. 74 00:03:14,250 --> 00:03:16,953 More detail using chronyc tracking.