[TACACS] Fix TACACS config revert to old config when device reboot issue.#22342
Merged
qiluo-msft merged 2 commits intosonic-net:masterfrom Apr 30, 2025
Merged
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run Azure.sonic-buildimage |
Collaborator
|
/AzurePipelines run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
qiluo-msft
reviewed
Apr 29, 2025
| echo "Applied tacacs json to restore tacacs credentials" | ||
| config save -y | ||
|
|
||
| # Change tacacs config file name, so tacacs config will not be revert when device reboot. |
Collaborator
Contributor
Author
There was a problem hiding this comment.
Complete remove the service is danger, because remove this service may cause SONiC missing TACACS config.
The OS upgrade scenario does not cover by sonic-mgmt test.
qiluo-msft
approved these changes
Apr 30, 2025
Collaborator
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.
Fix TACACS config revert to old config when device reboot issue.
Why I did it
Fix following bug:
Note: the TACACS config does not revert immediately after reboot, it will delay 5min 30sec:
https://github.com/sonic-net/sonic-buildimage/blob/master/files/build_templates/tacacs-config.timer
Work item tracking
How I did it
Move /etc/sonic/old_config/tacacs.json to /etc/sonic/old_config/tacacs.json_backup
How to verify it
Pass all test case.
Manually verify with following steps:
admin@vlab-01:~$ show tacacs
TACPLUS global auth_type login
TACPLUS global timeout 5 (default)
TACPLUS global passkey testing123
TACPLUS_SERVER address 10.250.0.102
priority 1
tcp_port 49
admin@vlab-01:~$ echo '
{
"TACPLUS": {"global": { "auth_type": "login", "passkey": "12345" } }
}
// then reboot device and wait for 6 minutes, because the TACACS config service will delay 5min 30sec after reboot:
https://github.com/sonic-net/sonic-buildimage/blob/master/files/build_templates/tacacs-config.timer
admin@vlab-01:
$ ls /etc/sonic/old_config/tacacs.json$ show tacacsls: cannot access '/etc/sonic/old_config/tacacs.json': No such file or directory
admin@vlab-01:
TACPLUS global auth_type login
TACPLUS global timeout 5 (default)
TACPLUS global passkey 12345
TACPLUS_SERVER address 10.250.0.102
priority 1
tcp_port 49
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Fix TACACS config revert to old config when device reboot issue.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)