Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to improve hostname handling #12064

Merged
merged 2 commits into from
Oct 25, 2022
Merged

Fix to improve hostname handling #12064

merged 2 commits into from
Oct 25, 2022

Conversation

devpatha
Copy link
Contributor

Why I did it

If config_db.json is missing hostname entry, hostname-config.sh ends up deleting existing entry too and hostname changes to default 'localhost'

How I did it

If hostname is not available from config_db.json, do not edit /etc/hostname and exit

How to verify it

with missing hostname entry in config_db.json, /etc/hostname entry is not cleared

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012 for Cisco 8102
  • 202106
  • 202111
  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 13, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: devpatha / name: Devesh Pathak (2259365)

@devpatha
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 12064 in repo sonic-net/sonic-buildimage

@balajib-cisco
Copy link

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 12064 in repo sonic-net/sonic-buildimage

@yxieca yxieca merged commit 85e3a81 into sonic-net:master Oct 25, 2022
yxieca pushed a commit that referenced this pull request Oct 25, 2022
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
yxieca pushed a commit that referenced this pull request Oct 25, 2022
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
qiluo-msft pushed a commit that referenced this pull request Oct 26, 2022
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
abdosi pushed a commit that referenced this pull request Jan 30, 2023
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants