Commit 90d21ec
committed
Use timedatectl to enable/disable ntp
Command timedatectl is used to set server time. However, if
disable chronyd before set_servertime by systemctl, timedatectl
may not sync the status in time, then the set-time will fail as
`Failed to set time: Automatic time synchronization is enabled`.
This is because systemd checks synchronization status periodically
and update its own NTP flag (which is timedatectl replied on)
To let timedatectl update NTP flag instantly, use timedatectl
set-ntp true/false to enable/disable the NTP.
Signed-off-by: Changlei Li <changlei.li@cloud.com>1 parent 1200a96 commit 90d21ec
2 files changed
+10
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 75 | | |
79 | | - | |
80 | | - | |
| 76 | + | |
81 | 77 | | |
82 | 78 | | |
83 | | - | |
84 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments