bind: Don't start a stopped daemon during changes/upgrades

Tests:

- Without patch, disable bind. Incrementing the app's version number results in
bind getting started.

- With patch, disable bind. Incrementing the app's version number does not
result in bind getting started.

- Without patch, disable bind. Update forwarders. Bind is running again.

- With patch, disable bind. Update forwarders. Bind is not running again.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2024-08-28 20:52:16 -07:00 committed by Veiko Aasa
parent fc66ed3121
commit 96b052432a
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -45,14 +45,14 @@ def setup(old_version: int):
Path(ZONES_DIR).mkdir(exist_ok=True, parents=True)
action_utils.service_restart('named')
action_utils.service_try_restart('named')
@privileged
def configure(forwarders: str):
"""Configure BIND."""
_set_forwarders(forwarders)
action_utils.service_restart('named')
action_utils.service_try_restart('named')
def get_config():