Skip to content

Commit

Permalink
ds-cloud-identify: allow disabling on FreeBSD
Browse files Browse the repository at this point in the history
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
  • Loading branch information
igalic committed Oct 6, 2023
1 parent 5c46995 commit 8537988
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions sysvinit/freebsd/dsidentify.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 8537988

Please sign in to comment.