Skip to content

Commit d53f05c

Browse files
kannankvszhenggen-xu
authored andcommitted
[ntp]: modified ntp script to hide the error related to cfggen (sonic-net#3745)
This PR is to handle the issue 3527. When device boots up, NTP throws a traceback as explained in the issue 3527. - Traceback will be seen when MGMT_VRF_CONFIG does not exist in the database. Traceback is coming from the script “/etc/init.d/ntp”. - Traceback does not affect the NTP functionality with/without management VRF. When MGMT_VRF_CONFIG does not exist or when MGMT_VRF_CONFIG’s mgmtVrfEnabled is configured to “false”, “NTP” will be started in the “default VRF” context, which is working fine even with this traceback. - This traceback error will be hidden by redirecting the error to /dev/null without affecting functionality.
1 parent efbe459 commit d53f05c

File tree

1 file changed

+1
-1
lines changed
  • files/image_config/ntp

1 file changed

+1
-1
lines changed

files/image_config/ntp/ntp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ case $1 in
5050
fi
5151
(
5252
flock -w 180 9
53-
vrfEnabled=$(/usr/local/bin/sonic-cfggen -d -v 'MGMT_VRF_CONFIG["vrf_global"]["mgmtVrfEnabled"]')
53+
vrfEnabled=$(/usr/local/bin/sonic-cfggen -d -v 'MGMT_VRF_CONFIG["vrf_global"]["mgmtVrfEnabled"]' 2> /dev/null)
5454
if [ "$vrfEnabled" = "true" ]
5555
then
5656
log_daemon_msg "Starting NTP server in mgmt-vrf" "ntpd"

0 commit comments

Comments
 (0)