Avoid removing localhost entry from /etc/hosts file#2452
Merged
lguohan merged 1 commit intosonic-net:masterfrom Jan 18, 2019
PrabhuSreenivasan:master
Merged
Avoid removing localhost entry from /etc/hosts file#2452lguohan merged 1 commit intosonic-net:masterfrom PrabhuSreenivasan:master
lguohan merged 1 commit intosonic-net:masterfrom
PrabhuSreenivasan:master
Conversation
lguohan
approved these changes
Jan 18, 2019
Collaborator
|
thank you for this fix! |
seiferteric
pushed a commit
to project-arlo/sonic-buildimage
that referenced
this pull request
Oct 14, 2019
…ic-net#2452) - What I did This fix removes the possibility of 'localhost' entry getting removed from /etc/hosts file by hostname-config service. Without this change, whenever we change the hostname from 'localhost' to any other name on the config_db.json and reload the config, /etc/hosts file will only have the new hostname on it. But there are multiple sonic utilities (eg: swssconfig) which relies on the hard coded 'localhost' name and they tend to stop working. - How I did it Added a new check on hostname-config.sh script to avid blindly deleting the line containing the old hostname from /etc/hosts file. Now it will delete the old hostname only if its not localhost or when the hostname is not changing. - How to verify it Bring up SONiC on a device with hostname as localhost Edit /etc/sonic/config_db.json to update the 'hostname' filed under DEVICE_METADATA from "hostname" : "localhost" --> "hostname" : "sonic" run config reload -y to reflect the hostname change done on config_db.json file. cat /etc/hosts and check whether both 127.0.0.1 localhost and 127.0.0.1 sonic entry are present on the file. ping localhost should work fine. - Description for the changelog Make hostname-config service more robust in handling SONiC hostname change from localhost to anything else. Change-Id: I4599bcaade05331d737f3e70f449dd51f7c636bb
seiferteric
pushed a commit
to project-arlo/sonic-buildimage
that referenced
this pull request
Oct 14, 2019
…le (sonic-net#2452)" into broadcom_sonic
zhenggen-xu
pushed a commit
to zhenggen-xu/sonic-buildimage
that referenced
this pull request
Oct 17, 2019
…ic-net#2452) - What I did This fix removes the possibility of 'localhost' entry getting removed from /etc/hosts file by hostname-config service. Without this change, whenever we change the hostname from 'localhost' to any other name on the config_db.json and reload the config, /etc/hosts file will only have the new hostname on it. But there are multiple sonic utilities (eg: swssconfig) which relies on the hard coded 'localhost' name and they tend to stop working. - How I did it Added a new check on hostname-config.sh script to avid blindly deleting the line containing the old hostname from /etc/hosts file. Now it will delete the old hostname only if its not localhost or when the hostname is not changing. - How to verify it Bring up SONiC on a device with hostname as localhost Edit /etc/sonic/config_db.json to update the 'hostname' filed under DEVICE_METADATA from "hostname" : "localhost" --> "hostname" : "sonic" run config reload -y to reflect the hostname change done on config_db.json file. cat /etc/hosts and check whether both 127.0.0.1 localhost and 127.0.0.1 sonic entry are present on the file. ping localhost should work fine. - Description for the changelog Make hostname-config service more robust in handling SONiC hostname change from localhost to anything else. RB=1534557 G=lnos-reviewers R=pchaudhary,pmao,rmolina,samaity,sfardeen,zxu A=
yxieca
pushed a commit
that referenced
this pull request
Oct 29, 2019
- What I did This fix removes the possibility of 'localhost' entry getting removed from /etc/hosts file by hostname-config service. Without this change, whenever we change the hostname from 'localhost' to any other name on the config_db.json and reload the config, /etc/hosts file will only have the new hostname on it. But there are multiple sonic utilities (eg: swssconfig) which relies on the hard coded 'localhost' name and they tend to stop working. - How I did it Added a new check on hostname-config.sh script to avid blindly deleting the line containing the old hostname from /etc/hosts file. Now it will delete the old hostname only if its not localhost or when the hostname is not changing. - How to verify it Bring up SONiC on a device with hostname as localhost Edit /etc/sonic/config_db.json to update the 'hostname' filed under DEVICE_METADATA from "hostname" : "localhost" --> "hostname" : "sonic" run config reload -y to reflect the hostname change done on config_db.json file. cat /etc/hosts and check whether both 127.0.0.1 localhost and 127.0.0.1 sonic entry are present on the file. ping localhost should work fine. - Description for the changelog Make hostname-config service more robust in handling SONiC hostname change from localhost to anything else.
stephenxs
added a commit
to stephenxs/sonic-buildimage
that referenced
this pull request
Nov 8, 2022
d5a6da3 Do not configure physical attributes on port channels in portconfig (sonic-net#2456) 48ee772 Change db_migrator major version on master branch from version 3 to 4 (sonic-net#2470) f374616 [GCU] Fix JsonPointerFilter bug (sonic-net#2477) 58dbb3e YANG Validation for ConfigDB Updates: TACPLUS, TACPLUS_SERVER, AAA, VLAN_SUB_INTERFACE tables + decorated validated_mod_entry (sonic-net#2452) 062f18a fix show interface neighbor expected empty issue (sonic-net#2465) 569edf3 Fix display disorder problem of show mirror_session (sonic-net#2447) daaf0ff Disable "tag as local" when reboot (sonic-net#2451) 6621120 Fix sudo sfputil show error-status on a multiasic platform issue (sonic-net#2373) e8b1dcd Add IP remove warnings for VRF commands (sonic-net#2351) 40cc8e1 [scripts/generate_dump] add information to tech-support file (sonic-net#2357) 8473517 Revert "[config reload]: On dual ToR systems, cache ARP and FDB table (sonic-net#2460) Signed-off-by: Stephen Sun <[email protected]>
yxieca
pushed a commit
that referenced
this pull request
Nov 11, 2022
#12639) * Advance submodule sonic-utilities d5a6da3 Do not configure physical attributes on port channels in portconfig (#2456) 48ee772 Change db_migrator major version on master branch from version 3 to 4 (#2470) f374616 [GCU] Fix JsonPointerFilter bug (#2477) 58dbb3e YANG Validation for ConfigDB Updates: TACPLUS, TACPLUS_SERVER, AAA, VLAN_SUB_INTERFACE tables + decorated validated_mod_entry (#2452) 062f18a fix show interface neighbor expected empty issue (#2465) 569edf3 Fix display disorder problem of show mirror_session (#2447) daaf0ff Disable "tag as local" when reboot (#2451) 6621120 Fix sudo sfputil show error-status on a multiasic platform issue (#2373) e8b1dcd Add IP remove warnings for VRF commands (#2351) 40cc8e1 [scripts/generate_dump] add information to tech-support file (#2357) 8473517 Revert "[config reload]: On dual ToR systems, cache ARP and FDB table (#2460) Signed-off-by: Stephen Sun <[email protected]> * Advance sonic-platform-common aa86083 Fix issue: rounding float value for txpower and rxpower (#320) 2052a63 Fix issue: copper cable should not display DOM information (#318) cf4c6af CmisApi::get_application_advertisement catch AttributeError as well (#316) Signed-off-by: Stephen Sun <[email protected]> Signed-off-by: Stephen Sun <[email protected]>
7 tasks
dbarashinvd
pushed a commit
to dbarashinvd/sonic-buildimage
that referenced
this pull request
May 22, 2023
…LAN_SUB_INTERFACE tables + decorated validated_mod_entry (sonic-net#2452)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
This fix removes the possibility of 'localhost' entry getting removed from /etc/hosts file by hostname-config service.
Without this change, whenever we change the hostname from 'localhost' to any other name on the config_db.json and reload the config, /etc/hosts file will only have the new hostname on it. But there are multiple sonic utilities (eg: swssconfig) which relies on the hard coded 'localhost' name and they tend to stop working.
- How I did it
Added a new check on hostname-config.sh script to avid blindly deleting the line containing the old hostname from /etc/hosts file. Now it will delete the old hostname only if its not
localhostor when the hostname is not changing.- How to verify it
localhost/etc/sonic/config_db.jsonto update the 'hostname' filed underDEVICE_METADATAfrom"hostname" : "localhost"-->"hostname" : "sonic"config reload -yto reflect the hostname change done on config_db.json file.cat /etc/hostsand check whether both127.0.0.1 localhostand127.0.0.1 sonicentry are present on the file.ping localhostshould work fine.- Description for the changelog
Make hostname-config service more robust in handling SONiC hostname change from
localhostto anything else.- A picture of a cute animal (not mandatory but encouraged)