diff options
author | Jeroen Roovers <jer@gentoo.org> | 2020-06-28 14:04:44 +0200 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2020-06-28 14:05:37 +0200 |
commit | 9207fdd5442a659ef9e18c75bad1eb277bb62ea5 (patch) | |
tree | 9df69da452b03fca0fe0199715a51d954db528a7 /net-analyzer | |
parent | net-analyzer/arpwatch: Use HTTPS in SRC_URI (diff) | |
download | gentoo-9207fdd5442a659ef9e18c75bad1eb277bb62ea5.tar.gz gentoo-9207fdd5442a659ef9e18c75bad1eb277bb62ea5.tar.bz2 gentoo-9207fdd5442a659ef9e18c75bad1eb277bb62ea5.zip |
net-analyzer/arpwatch: Install new conf.d/init.d scripts
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Bug: https://bugs.gentoo.org/602552
Closes: https://bugs.gentoo.org/727220
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/arpwatch/arpwatch-3.1.ebuild | 6 | ||||
-rw-r--r-- | net-analyzer/arpwatch/files/arpwatch.confd-r2 | 18 | ||||
-rw-r--r-- | net-analyzer/arpwatch/files/arpwatch.initd-r2 | 33 |
3 files changed, 54 insertions, 3 deletions
diff --git a/net-analyzer/arpwatch/arpwatch-3.1.ebuild b/net-analyzer/arpwatch/arpwatch-3.1.ebuild index 92a1c502738f..76be0e590a07 100644 --- a/net-analyzer/arpwatch/arpwatch-3.1.ebuild +++ b/net-analyzer/arpwatch/arpwatch-3.1.ebuild @@ -46,14 +46,14 @@ src_install() { newins "${WORKDIR}"/ethercodes.dat-${ETHERCODES_DATE} ethercodes.dat insinto /usr/share/arpwatch/awk - doins duplicates.awk euppertolower.awk p.awk e.awk d.awk + doins d.awk duplicates.awk e.awk euppertolower.awk p.awk diropts --group=arpwatch --mode=770 keepdir /var/lib/arpwatch dodoc README CHANGES - newinitd "${FILESDIR}"/arpwatch.initd-r1 arpwatch - newconfd "${FILESDIR}"/arpwatch.confd-r1 arpwatch + newconfd "${FILESDIR}"/arpwatch.confd-r2 arpwatch + newinitd "${FILESDIR}"/arpwatch.initd-r2 arpwatch } pkg_postinst() { diff --git a/net-analyzer/arpwatch/files/arpwatch.confd-r2 b/net-analyzer/arpwatch/files/arpwatch.confd-r2 new file mode 100644 index 000000000000..2937349cdc83 --- /dev/null +++ b/net-analyzer/arpwatch/files/arpwatch.confd-r2 @@ -0,0 +1,18 @@ +# See arpwatch.8 for more information + +# Specify the interface for arpwatch to listen on here (default: lo). +# If you need to listen on more than one interface, you should +# run multiple arpwatch services; for example "arpwatch" and +# "arpwatch.eth1". These additional services can be configured by +# symlinking to the "arpwatch" service script, and by creating a new +# conf.d file whose name matches the new service (symlink) name. +# +# Example: +# +# ARPWATCH_IFACE="eth0" +# +ARPWATCH_IFACE="lo" + +# Additional options to pass to arpwatch. +# See arpwatch(8) +ARPWATCH_OPTS="-N -p" diff --git a/net-analyzer/arpwatch/files/arpwatch.initd-r2 b/net-analyzer/arpwatch/files/arpwatch.initd-r2 new file mode 100644 index 000000000000..93438209e1f1 --- /dev/null +++ b/net-analyzer/arpwatch/files/arpwatch.initd-r2 @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Default to "lo" for the interface, so that the init script will work +# out-of-the-box. +: ${ARPWATCH_IFACE:=lo} + +ARPWATCH_DATAFILE="/var/lib/arpwatch/${RC_SVCNAME}.dat" + +command="/usr/sbin/arpwatch" +pidfile="/run/${RC_SVCNAME}.pid" +command_args=" + -i ${ARPWATCH_IFACE} + -f ${ARPWATCH_DATAFILE} + -P ${pidfile} + ${ARPWATCH_OPTS} +" + +depend() { + if [ -f "/proc/net/vlan/${ARPWATCH_IFACE}" ]; then + _if=$(grep -i "device" /proc/net/vlan/${ARPWATCH_IFACE} |awk '{print $2;}') + else + _if=${ARPWATCH_IFACE} + fi + need "net.${_if}" +} + +start_pre() { + # The "arpwatch" user must be a member of the "arpwatch" group for + # this to work. + checkpath --file --owner root:arpwatch --mode 0660 "${ARPWATCH_DATAFILE}" +} |