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
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
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
-#!/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 $?
-}
--- /dev/null
+#!/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
+}