Page MenuHomeDevCentral

D3591.diff
No OneTemporary

D3591.diff

diff --git a/roles/mailserver/dkim/files/rc/opendkim b/roles/mailserver/dkim/files/rc/opendkim
new file mode 100644
--- /dev/null
+++ b/roles/mailserver/dkim/files/rc/opendkim
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# PROVIDE: opendkim
+# REQUIRE: DAEMON
+# BEFORE: mail
+# KEYWORD: shutdown
+
+# -------------------------------------------------------------
+# OpenDKIM
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/mailserver/dkim/files/rc/opendkim
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+# opendkim_enable (bool): Set it to YES to enable the service.
+# Default is "NO"
+# opendkim_user (user): Set user to run opendkim
+# Default is "opendkim".
+# opendkim_group (group): Set user to run opendkim
+# Default is "mail".
+# opendkim_config (config file path): Set config to run opendkim
+# Default is "/usr/local/etc/opendkim/opendkim.conf".
+# opendkim_perms (perms): Set config to run opendkim
+# Default is "0755".
+
+. /etc/rc.subr
+
+name="opendkim"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${opendkim_enable:="NO"}
+: ${opendkim_user:="opendkim"}
+: ${opendkim_group:="mail"}
+: ${opendkim_config:="/usr/local/etc/opendkim/opendkim.conf"}
+: ${opendkim_perms:="0755"}
+
+pidfile="/var/run/opendkim.pid"
+socketfile="/var/run/opendkim.sock"
+command="/usr/local/sbin/opendkim"
+command_args="-l -u ${opendkim_user}:${opendkim_group} -P ${pidfile} -x ${opendkim_config}"
+
+start_precmd=opendkim_exec_startprecmd
+stop_postcmd=opendkim_exec_stop_postcmd
+
+opendkim_exec_startprecmd()
+{
+ touch ${pidfile}
+ chown ${opendkim_user} ${pidfile}
+ install -d -o ${opendkim_user} -g ${opendkim_group} -m ${opendkim_perms} ${socketfile}
+}
+
+opendkim_exec_stop_postcmd()
+{
+ rm -f ${pidfile}
+ rm -f ${socketfile}
+}
+
+run_rc_command "$1"
diff --git a/roles/mailserver/dkim/files/rc/milteropendkim.conf b/roles/mailserver/dkim/files/rc/opendkim.conf
rename from roles/mailserver/dkim/files/rc/milteropendkim.conf
rename to roles/mailserver/dkim/files/rc/opendkim.conf
--- a/roles/mailserver/dkim/files/rc/milteropendkim.conf
+++ b/roles/mailserver/dkim/files/rc/opendkim.conf
@@ -13,7 +13,5 @@
# and will be lost if the state is redeployed.
# </auto-generated>
-milteropendkim_enable="YES"
-milteropendkim_uid="{{ user }}"
-milteropendkim_gid="{{ group }}"
-milteropendkim_cfgfile="{{ config }}"
+opendkim_enable="YES"
+opendkim_perms="0775"
diff --git a/roles/mailserver/dkim/service.sls b/roles/mailserver/dkim/service.sls
--- a/roles/mailserver/dkim/service.sls
+++ b/roles/mailserver/dkim/service.sls
@@ -14,13 +14,12 @@
{% if services["manager"] == "rc" %}
-/etc/rc.conf.d/milter-opendkim:
+/etc/rc.conf.d/opendkim:
file.managed:
- - source: salt://roles/mailserver/dkim/files/rc/milteropendkim.conf
- - template: jinja
- - context:
- user: opendkim
- group: mail
- config: {{ dirs.etc }}/opendkim/opendkim.conf
+ - source: salt://roles/mailserver/dkim/files/rc/opendkim.conf
+
+/usr/local/etc/rc.d/opendkim:
+ file.managed:
+ - source: salt://roles/mailserver/dkim/files/rc/opendkim
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 10:10 (2 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2253013
Default Alt Text
D3591.diff (3 KB)

Event Timeline