Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/arpwatch/, net-analyzer/arpwatch/files/
Date: Sun, 28 Jun 2020 12:05:52
Message-Id: 1593345937.9207fdd5442a659ef9e18c75bad1eb277bb62ea5.jer@gentoo
1 commit: 9207fdd5442a659ef9e18c75bad1eb277bb62ea5
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 28 12:04:44 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 28 12:05:37 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9207fdd5
7
8 net-analyzer/arpwatch: Install new conf.d/init.d scripts
9
10 Package-Manager: Portage-2.3.103, Repoman-2.3.23
11 Bug: https://bugs.gentoo.org/602552
12 Closes: https://bugs.gentoo.org/727220
13 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
14
15 net-analyzer/arpwatch/arpwatch-3.1.ebuild | 6 ++---
16 net-analyzer/arpwatch/files/arpwatch.confd-r2 | 18 +++++++++++++++
17 net-analyzer/arpwatch/files/arpwatch.initd-r2 | 33 +++++++++++++++++++++++++++
18 3 files changed, 54 insertions(+), 3 deletions(-)
19
20 diff --git a/net-analyzer/arpwatch/arpwatch-3.1.ebuild b/net-analyzer/arpwatch/arpwatch-3.1.ebuild
21 index 92a1c502738..76be0e590a0 100644
22 --- a/net-analyzer/arpwatch/arpwatch-3.1.ebuild
23 +++ b/net-analyzer/arpwatch/arpwatch-3.1.ebuild
24 @@ -46,14 +46,14 @@ src_install() {
25 newins "${WORKDIR}"/ethercodes.dat-${ETHERCODES_DATE} ethercodes.dat
26
27 insinto /usr/share/arpwatch/awk
28 - doins duplicates.awk euppertolower.awk p.awk e.awk d.awk
29 + doins d.awk duplicates.awk e.awk euppertolower.awk p.awk
30
31 diropts --group=arpwatch --mode=770
32 keepdir /var/lib/arpwatch
33 dodoc README CHANGES
34
35 - newinitd "${FILESDIR}"/arpwatch.initd-r1 arpwatch
36 - newconfd "${FILESDIR}"/arpwatch.confd-r1 arpwatch
37 + newconfd "${FILESDIR}"/arpwatch.confd-r2 arpwatch
38 + newinitd "${FILESDIR}"/arpwatch.initd-r2 arpwatch
39 }
40
41 pkg_postinst() {
42
43 diff --git a/net-analyzer/arpwatch/files/arpwatch.confd-r2 b/net-analyzer/arpwatch/files/arpwatch.confd-r2
44 new file mode 100644
45 index 00000000000..2937349cdc8
46 --- /dev/null
47 +++ b/net-analyzer/arpwatch/files/arpwatch.confd-r2
48 @@ -0,0 +1,18 @@
49 +# See arpwatch.8 for more information
50 +
51 +# Specify the interface for arpwatch to listen on here (default: lo).
52 +# If you need to listen on more than one interface, you should
53 +# run multiple arpwatch services; for example "arpwatch" and
54 +# "arpwatch.eth1". These additional services can be configured by
55 +# symlinking to the "arpwatch" service script, and by creating a new
56 +# conf.d file whose name matches the new service (symlink) name.
57 +#
58 +# Example:
59 +#
60 +# ARPWATCH_IFACE="eth0"
61 +#
62 +ARPWATCH_IFACE="lo"
63 +
64 +# Additional options to pass to arpwatch.
65 +# See arpwatch(8)
66 +ARPWATCH_OPTS="-N -p"
67
68 diff --git a/net-analyzer/arpwatch/files/arpwatch.initd-r2 b/net-analyzer/arpwatch/files/arpwatch.initd-r2
69 new file mode 100644
70 index 00000000000..93438209e1f
71 --- /dev/null
72 +++ b/net-analyzer/arpwatch/files/arpwatch.initd-r2
73 @@ -0,0 +1,33 @@
74 +#!/sbin/openrc-run
75 +# Copyright 1999-2020 Gentoo Authors
76 +# Distributed under the terms of the GNU General Public License v2
77 +
78 +# Default to "lo" for the interface, so that the init script will work
79 +# out-of-the-box.
80 +: ${ARPWATCH_IFACE:=lo}
81 +
82 +ARPWATCH_DATAFILE="/var/lib/arpwatch/${RC_SVCNAME}.dat"
83 +
84 +command="/usr/sbin/arpwatch"
85 +pidfile="/run/${RC_SVCNAME}.pid"
86 +command_args="
87 + -i ${ARPWATCH_IFACE}
88 + -f ${ARPWATCH_DATAFILE}
89 + -P ${pidfile}
90 + ${ARPWATCH_OPTS}
91 +"
92 +
93 +depend() {
94 + if [ -f "/proc/net/vlan/${ARPWATCH_IFACE}" ]; then
95 + _if=$(grep -i "device" /proc/net/vlan/${ARPWATCH_IFACE} |awk '{print $2;}')
96 + else
97 + _if=${ARPWATCH_IFACE}
98 + fi
99 + need "net.${_if}"
100 +}
101 +
102 +start_pre() {
103 + # The "arpwatch" user must be a member of the "arpwatch" group for
104 + # this to work.
105 + checkpath --file --owner root:arpwatch --mode 0660 "${ARPWATCH_DATAFILE}"
106 +}