Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for DNS service being canceled (#18670)
#### Why I did it To fix `resolv-config.service` being cancelled: `resolv-config.service` is started from `hostcfgd` each time there is an [update to the dns configuration or during the start of hostcfgd. ](https://github.com/sonic-net/sonic-host-services/blob/6fce4781da508709f11be595e3c7048ffd3138cb/scripts/hostcfgd#L1406) When we perform `config reload` because `hostcfgd` is restarted `resolv-config.service` is also restarted, but due to dependency of [`resolv-config.service` on `sonic.target`](https://github.com/sonic-net/sonic-buildimage/blob/ed839c65055c3cbb446ddabdc9c15b0684988139/files/image_config/resolv-config/resolv-config.service#L5) `systemd` also tries to restart `resolv-config.service` causing cancellation of one of the instances of `resolv-config.service`. This fix removes the dependency of `resolv-config.service` on `sonic.target` #### How I did it By removing the `BindsTo` and `WantedBy` dependency to `sonic.target` the service is not restarted upon `config reload` by `systemd` anymore, which would solve the issue of the service being cancelled. #### How to verify it No occurrence of `Job for resolv-config.service canceled.` in `syslog` after this change is considered
- Loading branch information