From 8537988334a05509b964d52616ec3ef55e433c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mina=20Gali=C4=87?= Date: Wed, 4 Oct 2023 12:46:30 +0100 Subject: [PATCH] ds-cloud-identify: allow disabling on FreeBSD sometimes it's preferable to disable ds-identify, for example when the results it returns are bogus, or when we know the results can set them ourselves, because they are unchanging. Allow disabling the service, rather than having to delete it. Sponsored by: The FreeBSD Foundation --- sysvinit/freebsd/dsidentify.tmpl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sysvinit/freebsd/dsidentify.tmpl b/sysvinit/freebsd/dsidentify.tmpl index 9a00c663b10..2bb0cfcf208 100755 --- a/sysvinit/freebsd/dsidentify.tmpl +++ b/sysvinit/freebsd/dsidentify.tmpl @@ -23,18 +23,21 @@ rcvar="cloudinit_enable" dsidentify_start() { - echo "${command} starting" - if kenv -q kernel_options | grep -q 'cloud-init=disabled'; then - warn "cloud-init is disabled via kernel_options." - elif test -e {{ prefix }}/etc/cloud-init.disabled; then - warn "cloud-init is disabled via cloud-init.disabled file." - else - ${command} + if checkyesno cloudinit_dsidentify_enable; then + echo "${command} starting" + if kenv -q kernel_options | grep -q 'cloud-init=disabled'; then + warn "cloud-init is disabled via kernel_options." + elif test -e {{ prefix }}/etc/cloud-init.disabled; then + warn "cloud-init is disabled via cloud-init.disabled file." + else + ${command} + fi fi } load_rc_config 'cloudinit' : ${cloudinit_enable="NO"} +: ${cloudinit_dsidentify_enable="YES"} run_rc_command "$1"