-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
dodoc AUTHORS CHANGES INSTALL README TODO
- newinitd "${FILESDIR}/amavisd-milter.initd" amavisd-milter
+ newinitd "${FILESDIR}/amavisd-milter.initd-r1" amavisd-milter
newconfd "${FILESDIR}/amavisd-milter.confd" amavisd-milter
}
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
dodoc AUTHORS CHANGES INSTALL README TODO
- newinitd "${FILESDIR}/amavisd-milter.initd" amavisd-milter
+ newinitd "${FILESDIR}/amavisd-milter.initd-r1" amavisd-milter
newconfd "${FILESDIR}/amavisd-milter.confd" amavisd-milter
}
--- /dev/null
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+NAME="amavisd-milter"
+DAEMON="/usr/sbin/${NAME}"
+
+depend() {
+ use logger dns amavisd sendmail
+}
+
+start() {
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --quiet --exec "${DAEMON}" -p "${PIDFILE}" --user amavis -- ${DOPTIONS}
+ eend $? "Failed to start ${NAME}"
+}
+
+stop() {
+ ebegin "Stopping ${NAME}"
+ start-stop-daemon --stop --name "${NAME}"
+ eend $? "Failed to stop ${NAME}"
+}
+
+restart() {
+ svc_stop
+ # needed to avoid potential mi_stop errors
+ sleep 4
+ svc_start
+}