Skip to content

Commit

Permalink
[ntp]: NTP service ordering (sonic-net#6115)
Browse files Browse the repository at this point in the history
Make sure ntp-config service is executed before ntpd

Updated ntp-config service files to force dependency with ntp service. Also resolved circular dependency with --no-block flag. (needed as ntp-config service internally invokes systemd to restart ntp which in turn waits for ntp-config to complete)

Signed-off-by: Prabhu Sreenivasan <[email protected]>
  • Loading branch information
PrabhuSreenivasan authored and santhosh-kt committed Feb 25, 2021
1 parent 4a8d1f6 commit a1ede4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions files/image_config/ntp/ntp-config.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Description=Update NTP configuration
Requires=updategraph.service
After=updategraph.service
Before=ntp.service

[Service]
Type=oneshot
Expand Down
2 changes: 1 addition & 1 deletion files/image_config/ntp/ntp-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ get_database_reboot_type
echo "Disabling NTP long jump for reboot type ${reboot_type} ..."
modify_ntp_default "s/NTPD_OPTS='-g'/NTPD_OPTS='-x'/"

systemctl restart ntp
systemctl --no-block restart ntp

0 comments on commit a1ede4e

Please sign in to comment.