Skip to content

Commit d9e6256

Browse files
authored
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
1 parent 4956cf3 commit d9e6256

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

files/image_config/resolv-config/resolv-config.service

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Description=Update DNS configuration
33
Requires=config-setup.service
44
After=config-setup.service
5-
BindsTo=sonic.target
65
After=sonic.target
76
StartLimitIntervalSec=0
87

@@ -11,5 +10,3 @@ Type=oneshot
1110
RemainAfterExit=yes
1211
ExecStart=/usr/bin/resolv-config.sh start
1312

14-
[Install]
15-
WantedBy=sonic.target

0 commit comments

Comments
 (0)