diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-07-19 22:05:27 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-07-19 22:05:27 +0100 |
commit | 121ed4eec41fbf03e1998d09eede1bf449da63b9 (patch) | |
tree | ce9341d77d1507f67d4a3a1472da9011b5baa0a8 /mail-filter/mimedefang/files/mimedefang.init | |
parent | dd762ff83c330186ee2ede002e08b2f780cddd51 (diff) |
gentoo resync : 19.07.2019
Diffstat (limited to 'mail-filter/mimedefang/files/mimedefang.init')
-rw-r--r-- | mail-filter/mimedefang/files/mimedefang.init | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/mail-filter/mimedefang/files/mimedefang.init b/mail-filter/mimedefang/files/mimedefang.init new file mode 100644 index 000000000000..931f47bf5919 --- /dev/null +++ b/mail-filter/mimedefang/files/mimedefang.init @@ -0,0 +1,60 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +SPOOLDIR="${SPOOLDIR:-/var/spool/MIMEDefang}" +PID="${SPOOLDIR}/mimedefang.pid" +MXPID="${SPOOLDIR}/mimedefang-multiplexor.pid" +LOCK="${SPOOLDIR}/mimedefang.lock" +MXLOCK="${SPOOLDIR}/mimedefang-multiplexor.lock" + +# Make sure required vars are set +SOCKET="${SOCKET:-${SPOOLDIR}/mimedefang.sock}" +MX_SOCKET="${MX_SOCKET:-${SPOOLDIR}/mimedefang-multiplexor.sock}" + +description="MIMEDefang mail filter" +extra_commands="checkconfig" +description_checkconfig="Check config for ${RC_SVCNAME}" + +depend() { + use antivirus +} + +checkconfig() { + checkpath -d "${SPOOLDIR}" + einfo "multiplexor socket: ${MX_SOCKET}" + einfo "sendmail socket: ${SOCKET}" +} + +start() { + checkconfig || return 1 + + # First start mimedefang multiplexor + rm -f "${MX_SOCKET}" > /dev/null 2>&1 + ebegin "Starting mimedefang-multiplexor" + start-stop-daemon --start --quiet \ + --exec /usr/bin/mimedefang-multiplexor -- -p "${MXPID}" -o "${MXLOCK}" -z "${SPOOLDIR}" \ + ${MD_MX_OPTS} ${MX_OPTS} \ + -s "${MX_SOCKET}" + eend $? "Failed to start mimedefang-multiplexor" + + # And now start mimedefang + rm -f "${SOCKET}" > /dev/null 2>&1 + ebegin "Starting mimedefang" + start-stop-daemon --start --quiet \ + --exec /usr/bin/mimedefang -- -P "${PID}" -o "${LOCK}" -z "${SPOOLDIR}" \ + ${MD_MX_OPTS} ${MD_OPTS} \ + -m "${MX_SOCKET}" \ + -p "${SOCKET}" + eend $? "Failed to start mimedefang" +} + +stop() { + ebegin "Stopping mimedefang" + start-stop-daemon --stop --quiet --pidfile "${PID}" + eend $? "Failed to stop mimedefang" + + ebegin "Stopping mimedefang-multiplexor" + start-stop-daemon --stop --quiet --pidfile "${MXPID}" + eend $? "Failed to stop mimedefang-multiplexor" +} |