diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/softflowd/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/softflowd/files')
4 files changed, 87 insertions, 0 deletions
diff --git a/net-analyzer/softflowd/files/softflowd-0.9.9-_GNU_SOURCE.patch b/net-analyzer/softflowd/files/softflowd-0.9.9-_GNU_SOURCE.patch new file mode 100644 index 000000000000..cb4844803e00 --- /dev/null +++ b/net-analyzer/softflowd/files/softflowd-0.9.9-_GNU_SOURCE.patch @@ -0,0 +1,13 @@ +setresuid and setresgid need _GNU_SOURCE which clashes with _BSD_SOURCE + +--- a/configure.ac ++++ b/configure.ac +@@ -87,7 +87,7 @@ + AC_SEARCH_LIBS(socket, socket) + AC_CHECK_LIB(pcap, pcap_open_live) + +-AC_CHECK_FUNCS(closefrom daemon setresuid setreuid setresgid setgid strlcpy strlcat) ++AC_CHECK_FUNCS(closefrom daemon setreuid setgid strlcpy strlcat) + + AC_CHECK_TYPES([u_int64_t, int64_t, uint64_t, u_int32_t, int32_t, uint32_t]) + AC_CHECK_TYPES([u_int16_t, int16_t, uint16_t, u_int8_t, int8_t, uint8_t]) diff --git a/net-analyzer/softflowd/files/softflowd-0.9.9-no-strip.patch b/net-analyzer/softflowd/files/softflowd-0.9.9-no-strip.patch new file mode 100644 index 000000000000..c48603a7f491 --- /dev/null +++ b/net-analyzer/softflowd/files/softflowd-0.9.9-no-strip.patch @@ -0,0 +1,12 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -52,7 +52,7 @@ + $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) + [ -d $(DESTDIR)$(mandir)/man8 ] || \ + $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man8 +- $(INSTALL) -m 0755 -s softflowd $(DESTDIR)$(sbindir)/softflowd +- $(INSTALL) -m 0755 -s softflowctl $(DESTDIR)$(sbindir)/softflowctl ++ $(INSTALL) -m 0755 softflowd $(DESTDIR)$(sbindir)/softflowd ++ $(INSTALL) -m 0755 softflowctl $(DESTDIR)$(sbindir)/softflowctl + $(INSTALL) -m 0644 softflowd.8 $(DESTDIR)$(mandir)/man8/softflowd.8 + $(INSTALL) -m 0644 softflowctl.8 $(DESTDIR)$(mandir)/man8/softflowctl.8 diff --git a/net-analyzer/softflowd/files/softflowd.confd b/net-analyzer/softflowd/files/softflowd.confd new file mode 100644 index 000000000000..dc1a36c874cd --- /dev/null +++ b/net-analyzer/softflowd/files/softflowd.confd @@ -0,0 +1,9 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# Copy conf file to softflowd.interface + +# SOFTFLOWD_COLLECTOR=host:port +# SOFTFLOWD_TIMEOUTS="maxlife=600" +# SOFTFLOWD_MAXFLOWS=17000 +# SOFTFLOWD_EXTRA= +# SOFTFLOWD_INTERFACE_IDX= diff --git a/net-analyzer/softflowd/files/softflowd.initd b/net-analyzer/softflowd/files/softflowd.initd new file mode 100644 index 000000000000..c0c2a831c629 --- /dev/null +++ b/net-analyzer/softflowd/files/softflowd.initd @@ -0,0 +1,53 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +softflowd_checkconfig() { + SOFTFLOWD_INTERFACE=${SVCNAME#*.} + if [ ${SOFTFLOWD_INTERFACE} = ${SVCNAME} ]; then + eerror "You have to create an init script for each interface:" + eerror "ln -s softflowd /etc/init.d/softflowd.eth0" + return 1 + fi + + if [ -z "${SOFTFLOWD_COLLECTOR}" ]; then + eerror "Specify the host and port that the accounting datagrams are to be" + eerror "sent to in /etc/conf.d/${SVCNAME}." + eerror "Example: SOFTFLOWD_COLLECTOR=collector.example.com:9995" + return 1 + fi + SOFTFLOWD_PIDFILE="/var/run/softflowd.${SOFTFLOWD_INTERFACE}.pid" + SOFTFLOWD_CTLFILE="/var/run/softflowd.${SOFTFLOWD_INTERFACE}.ctl" +} + + +start() { + softflowd_checkconfig || return 1 + + ebegin "Starting softflowd on interface ${SOFTFLOWD_INTERFACE}" + iface_arg=${SOFTFLOWD_INTERFACE} + [ -n "${SOFTFLOWD_INTERFACE_IDX}" ] && iface_arg="${SOFTFLOWD_INTERFACE_IDX}:${iface_arg}" + start-stop-daemon --start \ + --exec /usr/sbin/softflowd \ + -- -i "${iface_arg}" \ + -n "${SOFTFLOWD_COLLECTOR}" \ + -p "${SOFTFLOWD_PIDFILE}" \ + -c "${SOFTFLOWD_CTLFILE}" \ + -t "${SOFTFLOWD_TIMEOUTS-maxlife=600}" \ + -m "${SOFTFLOWD_MAXFLOWS-17000}" \ + ${SOFTFLOWD_EXTRA} + eend $? +} + +stop() { + softflowd_checkconfig || return 1 + + ebegin "Stopping softflowd on interface ${SOFTFLOWD_INTERFACE}" + # use softflowd's own way to shut it down + /usr/sbin/softflowctl -c ${SOFTFLOWD_CTLFILE} shutdown + eend $? +} |