summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/openrc-net/PKGBUILD16
-rw-r--r--pcr/openrc-net/opendkim.initd55
2 files changed, 67 insertions, 4 deletions
diff --git a/pcr/openrc-net/PKGBUILD b/pcr/openrc-net/PKGBUILD
index d7fc1129a..2ae3c88c4 100644
--- a/pcr/openrc-net/PKGBUILD
+++ b/pcr/openrc-net/PKGBUILD
@@ -24,6 +24,7 @@ pkgname=('apache-openrc'
'krb5-openrc'
'lighttpd-openrc'
'nginx-openrc'
+ 'opendkim-openrc'
'openldap-openrc'
'openntpd-openrc'
'opensmtpd-openrc'
@@ -46,7 +47,7 @@ pkgname=('apache-openrc'
'wicd-openrc'
'x2goserver-openrc'
'xinetd-openrc')
-pkgver=20180422
+pkgver=20180424
pkgrel=1
pkgdesc="OpenRC init scripts"
arch=('any')
@@ -82,6 +83,7 @@ source=("${_dev_url}/gentoo-apache-${_apver}-${_aprel}.tar.bz2"
"ntpd.initd::${_url}/net-misc/openntpd/files/openntpd.init.d-20080406-r6"
"sshd.confd::${_url}/net-misc/openssh/files/sshd.confd"
"sshd.initd::${_url}/net-misc/openssh/files/sshd.rc6.4"
+ "opendkim.initd"
"openvpn.confd::${_url}/net-vpn/openvpn/files/openvpn-2.1.conf"
"openvpn.initd::${_url}/net-vpn/openvpn/files/openvpn-2.1.init"
"smtpd.initd::${_url}/mail-mta/opensmtpd/files/smtpd.initd"
@@ -140,9 +142,9 @@ sha512sums=('68f0c4de38ae05c45839fe692cbb7de641e331ca133b8aaaf69f3659dec15833cda
'3945dc4cff9b20bddd2ac4f38d045f8caabb59368ab0b5e952d4194d06a1bdd9871546b84e9a54b692d2e3ca699aa065e5fa909a29ae80e102ed9635c94bcfd5'
'016094e0ac80817c8c1eb8a52a527c8a673b3ee904f2c04bef0304b5dfe1c778a34a2d5321cc5540a1dfe2e14dc878c44a1e54fd0263aca3917600827c6d9059'
'eff7820dea7f79420ddc78fc744a34f6f5cedbf167d7ce98ed35d4ae0b1dab6cae026d5255a6cc428cdbc8f51784ed149c5ec8011ab72c31c65a5bfc6664b94f'
- 'f76e98cfd48303d3095f2c9af0e81da7fd2def6d62fcadb881e64dd565af354cff65325d678c6d78cb62fffab67723513c1818a5f5c7606f21aa3a651bd8722b'
'b9ae816af54a55e134a9307e376f05367b815f1b3fd545c2a2c312d18aedcf907f413e8bad8db980cdd9aad4011a72a79e1e94594f69500939a9cb46287f2f81'
'fe58e950514743a72467233ff2f2a63112c50e5db843d61e141a5ca3dd8ef8f42a616cd9de7748ae582054c47c2cc38ce48b638e2d88be39c1387f77e79c83e1'
+ '756f48579e2913aa50a547ea7a0a534e0b0cfb4b3246f97a232360331e3dd2fe891effba4c7ac36c3f4b73867b3d75e4d58fd3c428249b73a67e54b54f5e2f0f'
'982ade883afbe2e656a9cbbe36c31c0e8b4f7bbbe5b63df9f7b834f02a9153032fb7445c85d3e91f62c68a7ddd13c3afbf420fb71cdd13d9c4b69f867bdd9f37'
'2d97a41b3998c196c440dcaf43ad8992eae27c5356c94b24f4cc4b20169350f3d6c8d65bb9c2517415ee15637fa60298d9cd8252ad9aa3eec6ae3a847ede0611'
'e4c8386bd7e8d8171172aa181305a55ca67cba6d4c82d77d8846e1bd3301dd9d118bb39dad6c144677f050194de813e4d83e06ea6dd591d4f07da8c4a1edde37'
@@ -153,8 +155,6 @@ sha512sums=('68f0c4de38ae05c45839fe692cbb7de641e331ca133b8aaaf69f3659dec15833cda
'df2ef4d9e65fa72daa9a7d91d69a06027d0e0fbc48f9ebd485e2d51990c8d00985b7ccf41314f984975e8073e2075bbdfe5543754718381497c334dc7d96451a'
'6fc7edf192957f97b171c97482317bf563385917cfdbf950ed28d9387961bd16f82844c6f9b5c430508ec6dc7331ecdf5f81fa3135663316061c1d0b1808f53d'
'8627b32446afed2cf1238eafc0f154ddb6c16857ee96f959e47f8d485b7317354afe59a08fcb3adbd17da087069cf2b94020a44b9190d597b40afd0b8aedf9a5'
- 'f8b0dd74a601a8bfadc96f75caeb037059ba4330dc2b52cc113ce9be38b020f098cbc747bfe977ca4dfa6e2ce634a64949ca5cf41a40c16fa90227e49ac9052f'
- 'ec398f06db147bc8ddf98b0d6a200af40c082053062b56a3fe78b1de6629cd7bf0b188e9baf44c1634f5f9f8ce8494a8a71be63c1e3f71838b77de58dbb45c71'
'94e7b6cf5867d123fc1252cdb200906da80b2df4563c35d9e28db8bf0a4fac812797ad13c214a6d41bdac4d70d62d3bbcd3990f8405b3585f1a41c4db1f1be48'
'627b6a4d54adf2feeaaf2197a5193c6f216812eab685ee833bdf4e3d765f40996790c0a4e22ff618d23985053e96a521fb48d19a648ab47ff2b0e9c23621a7e8'
'018418d0ef66c9ab5d67a8e68ed6f95c7a04ad2a8a073747f39d9db8e83cf72c685d388a727363788042e45d440a69651ec928ccdeed835915ebc8c676b43519'
@@ -333,6 +333,14 @@ package_nginx-openrc() {
}
+package_opendkim-openrc() {
+ pkgdesc="OpenRC opendkim init script"
+ depends=('openrc' 'opendkim')
+
+ _inst_initd 'opendkim'
+
+}
+
package_openldap-openrc() {
pkgdesc="OpenRC openldap init script"
depends=('openrc' 'openldap')
diff --git a/pcr/openrc-net/opendkim.initd b/pcr/openrc-net/opendkim.initd
new file mode 100644
index 000000000..0d075d166
--- /dev/null
+++ b/pcr/openrc-net/opendkim.initd
@@ -0,0 +1,55 @@
+#!/usr/bin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+CONFFILE=/etc/opendkim/${SVCNAME}.conf
+
+depend() {
+ use dns logger net
+ before mta
+}
+
+check_cfg() {
+
+ PIDFILE=$(sed -ne 's/^[[:space:]]*PidFile[[:space:]]\+//p' "${CONFFILE}")
+ local PIDDIR="${PIDFILE%/*}"
+ if [ ! -d "${PIDDIR}" ] ; then
+ checkpath -q -d -o opendkim:mail -m 0755 "${PIDDIR}" || return 1
+ fi
+ if [ ! -f "${CONFFILE}" ] ; then
+ eerror "Configuration file ${CONFFILE} is missing"
+ return 1
+ fi
+ if [ -z "${PIDFILE}" ] ; then
+ eerror "Configuration file needs PidFile setting - recommend adding 'PidFile /run/opendkim/${SVCNAME}.pid' to ${CONFFILE}"
+ return 1
+ fi
+
+ if egrep -q '^[[:space:]]*Background[[:space:]]+no' "${CONFFILE}" ; then
+ eerror "${SVCNAME} service cannot run with Background key set to yes!"
+ return 1
+ fi
+}
+
+start() {
+ check_cfg || return 1
+
+ # Remove stalled Unix socket if no other process is using it
+ local UNIX_SOCKET=$(sed -ne 's/^[[:space:]]*Socket[[:space:]]\+\(unix\|local\)://p' "${CONFFILE}")
+
+ if [ -S "${UNIX_SOCKET}" ] && ! fuser -s "${UNIX_SOCKET}"; then
+ rm "${UNIX_SOCKET}"
+ fi
+
+ ebegin "Starting OpenDKIM"
+ start-stop-daemon --start --pidfile "${PIDFILE}" \
+ --exec /usr/bin/opendkim -- -x "${CONFFILE}"
+ eend $?
+}
+
+stop() {
+ check_cfg || return 1
+ ebegin "Stopping OpenDKIM"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}