mail-filter/amavisd-new: revbump for improved init scripts
authorMarc Schiffbauer <mschiff@gentoo.org>
Thu, 15 Oct 2015 18:47:06 +0000 (20:47 +0200)
committerMarc Schiffbauer <mschiff@gentoo.org>
Thu, 15 Oct 2015 19:25:33 +0000 (21:25 +0200)
Fix for amavis-mc inti script.

Added new (missing) amavisd-snmp init script which is used for both,
amavisd-snmp-subagent and amavisd-snmp-subagent-zmq.

amavisd-snmp-subagent-zmq will be used if available and nothing
else is defined by the user via
/etc/conf.d/amavisd-snmp:amavisd_snmp_command=

Package-Manager: portage-2.2.23

mail-filter/amavisd-new/amavisd-new-2.9.1-r1.ebuild [moved from mail-filter/amavisd-new/amavisd-new-2.9.1.ebuild with 97% similarity]
mail-filter/amavisd-new/files/amavis-mc.initd
mail-filter/amavisd-new/files/amavisd-snmp.initd [new file with mode: 0644]

similarity index 97%
rename from mail-filter/amavisd-new/amavisd-new-2.9.1.ebuild
rename to mail-filter/amavisd-new/amavisd-new-2.9.1-r1.ebuild
index 83c2ccb8913262754677df3e2f7ce2e1feef9796..860a1e3489e681adabc820a8f64a4b9819997459 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -108,6 +108,7 @@ src_install() {
                dosbin amavisd-snmp-subagent
                use zmq && dosbin amavisd-snmp-subagent-zmq
                dodoc AMAVIS-MIB.txt
+               newinitd "${FILESDIR}"/amavisd-snmp.initd amavisd-snmp
        fi
 
        if use zmq ; then
index d194139360a178a8ebc79d29a8bcf5ccfdaff1fa..0725ef99143ed46bb42e596550e6941201ecb22c 100644 (file)
@@ -1,24 +1,14 @@
-#!/sbin/runscript
-# Copyright 1999-2012 Gentoo Foundation
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-prog="/usr/sbin/amavis-mc"
-progname="amavis-mc"
+pidfile="/run/amavis/amavis-mc.pid"
+command="/usr/sbin/amavis-mc"
+command_args="${amavis_mc_args} -P ${pidfile}"
+start_stop_daemon_args="--interpreted"
 
 depend() {
        use logger
        before amavisd-new snmpd
 }
-
-start() {
-       ebegin "Starting ${progname}"
-       start-stop-daemon --start --exec ${prog}
-       eend $?
-}
-
-stop() {
-       ebegin "Stopping ${progname}"
-       start-stop-daemon --stop --interpreted --exec ${prog}
-       eend $?
-}
diff --git a/mail-filter/amavisd-new/files/amavisd-snmp.initd b/mail-filter/amavisd-new/files/amavisd-snmp.initd
new file mode 100644 (file)
index 0000000..e42fe47
--- /dev/null
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+name="amavisd-snmp"
+pidfile="/run/amavis/${name}.pid"
+command="/usr/sbin/${name}-subagent"
+command_args="${amavis_snmp_args} -P ${pidfile}"
+start_stop_daemon_args="--interpreted"
+
+depend() {
+       use logger
+       before amavisd-new snmpd
+}
+
+start_pre() {
+       if [[ -x ${command}-zmq && ! $amavisd_snmp_command ]]; then
+               command="${command}-zmq"
+       fi
+}