From fe523fe9937dd05a0deb3cbbd79cf4311e46112d Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 16 May 2024 12:36:40 +0200 Subject: [PATCH] __opendkim: fix start_on_boot on FreeBSD There was a bit of an oddity with this, it is implemented in a way that should not be an issue for other systems. Reviewed at: https://code.ungleich.ch/ungleich-public/cdist-contrib/pulls/31 --- type/__opendkim/manifest | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/type/__opendkim/manifest b/type/__opendkim/manifest index dbd9fc0..28dd808 100755 --- a/type/__opendkim/manifest +++ b/type/__opendkim/manifest @@ -29,6 +29,7 @@ case "$os" in 'freebsd') CFG_DIR="/usr/local/etc/mail" service="milter-opendkim" + start_service="milteropendkim" ;; *) printf "__opendkim does not yet support %s.\n" "$os" >&2 @@ -90,7 +91,11 @@ fi require="__package/opendkim" __file "$target_file" \ --source "$source_file" --mode 0644 -require="__package/opendkim" __start_on_boot "${service}" +# Due to the way rc.conf works on *BSD, we find ourselves in the awkward +# situation, where a service's name can contain a '-' symbol, but the +# rc.conf setting to enable a service at boot cannot. +# Unless start_service has been defined before, these two match. +require="__package/opendkim" __start_on_boot "${start_service:-${service}}" # Ensure Key and Signing tables exist and have proper permissions key_table="${CFG_DIR}/KeyTable" @@ -105,7 +110,7 @@ require="__package/opendkim" \ --mode 444 require="__file${target_file} __file${key_table} - __file${signing_table} __start_on_boot/${service}" \ + __file${signing_table} __start_on_boot/${start_service:-${service}}" \ __check_messages opendkim \ --pattern "^__file${target_file}" \ --execute "service ${service} restart"