summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChema Alonso Josa <nimiux@gentoo.org>2016-09-27 09:36:25 +0200
committerChema Alonso Josa <nimiux@gentoo.org>2016-09-27 09:36:25 +0200
commit9e2e57f1d1366669a1e0ae83fc1f8d474cd8e927 (patch)
treee5681c3a43c0731c346b3939ce4855bd2250088c /app-admin
parentapp-backup/amanda: amd64 stable wrt bug #549626 (diff)
downloadgentoo-9e2e57f1d1366669a1e0ae83fc1f8d474cd8e927.tar.gz
gentoo-9e2e57f1d1366669a1e0ae83fc1f8d474cd8e927.tar.bz2
gentoo-9e2e57f1d1366669a1e0ae83fc1f8d474cd8e927.zip
app-admin/swatch: renamed to app-admin/swatchdog
To satisfy a request made by the old Swiss watch company Package-Manager: portage-2.2.28
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/swatchdog/Manifest1
-rw-r--r--app-admin/swatchdog/files/swatchdog-confd25
-rw-r--r--app-admin/swatchdog/files/swatchdog-init53
-rw-r--r--app-admin/swatchdog/files/swatchdogrc10
-rw-r--r--app-admin/swatchdog/metadata.xml24
-rw-r--r--app-admin/swatchdog/swatchdog-3.2.4.ebuild32
6 files changed, 145 insertions, 0 deletions
diff --git a/app-admin/swatchdog/Manifest b/app-admin/swatchdog/Manifest
new file mode 100644
index 000000000000..b4cc4e644b20
--- /dev/null
+++ b/app-admin/swatchdog/Manifest
@@ -0,0 +1 @@
+DIST swatchdog-3.2.4.tar.gz 30122 SHA256 5bb644d3750ee89b9aecab797df66b28b9fd174a5f0f96cd62367af8975b4f63 SHA512 4e0a4e3feed00df0f0d04f94cc090e53e71fa9b20d46236ec41d63b98b5733d80a5941b491cffcbb0b655a9c7d2b5c9423ca7ae043346dbe1b05ee6ab24b9489 WHIRLPOOL 1681139e54e5f665c2573983e8488859f907b3083f3ca1106faca137fb0b978cb0b90218899728ae8775334360b28ec4572f78415bca47a6d8a1a72be9f86ef5
diff --git a/app-admin/swatchdog/files/swatchdog-confd b/app-admin/swatchdog/files/swatchdog-confd
new file mode 100644
index 000000000000..13f8a0aed79e
--- /dev/null
+++ b/app-admin/swatchdog/files/swatchdog-confd
@@ -0,0 +1,25 @@
+# /etc/conf.d/swatchdog: config file for /etc/init.d/swatchdog
+
+# Path to the swatchdog program.
+#SWATCHDOG_BINARY="/usr/bin/swatchdog"
+
+# Swatchrc to read patterns and actions from.
+#SWATCHDOGRC="/etc/swatchdogrc"
+
+# File to monitor
+#SWATCHDOG_TAILFILE="/var/log/syslog"
+
+# Arguments to tail program
+#SWATCHDOG_TAILARGS=""
+
+# Swatch log file
+#SWATCHDOG_LOGFILE="/var/log/swatchdog.log"
+
+# Swatch error file
+#SWATCHDOG_ERRFILE="/var/log/swatchdog-err.log"
+
+# Where to output the generated script to. Should not be writable by others.
+#SWATCHDOG_SCRIPT="/run/swatchdog/swatchdog_script.pl"
+
+# Whether to parse the complete file once at startup. Defaults to "NO".
+PARSE_FULL="NO"
diff --git a/app-admin/swatchdog/files/swatchdog-init b/app-admin/swatchdog/files/swatchdog-init
new file mode 100644
index 000000000000..7db43eb24266
--- /dev/null
+++ b/app-admin/swatchdog/files/swatchdog-init
@@ -0,0 +1,53 @@
+#!/sbin/openrc-run
+# This script is based on the one created by Phil (bug #255329).
+
+depend() {
+ need logger
+}
+
+SWATCHDOG_BINARY=${SWATCHDOG_BINARY:-/usr/bin/swatchdog}
+SWATCHDOGRC=${SWATCHDOGRC:-/etc/swatchdogrc}
+SWATCHDOG_TAILFILE=${SWATCHDOG_TAILFILE:-/var/log/syslog}
+SWATCHDOG_LOGFILE=${SWATCHDOG_LOGFILE:-/var/log/swatchdog.log}
+SWATCHDOG_ERRFILE=${SWATCHDOG_ERRFILE:-/var/log/swatchdog-err.log}
+SWATCHDOG_SCRIPT=${SWATCHDOG_SCRIPT:-/run/swatchdog/swatchdog_script.pl}
+
+gen_script() {
+ local tailargs=""
+ if [ "${SWATCHDOG_TAILARGS}" ]; then
+ tailargs="--tail-args=\"${SWATCHDOG_TAILARGS}\""
+ fi
+ ebegin "Generating swatchdog script from config"
+ ${SWATCHDOG_BINARY} --dump-script="${SWATCHDOG_SCRIPT}" \
+ --use-cpan-file-tail ${tailargs} \
+ --config-file "${SWATCHDOGRC}" $1 "${SWATCHDOG_TAILFILE}"
+ eend $?
+}
+
+parse_full() {
+ gen_script --examine
+ ebegin "Parsing complete file once"
+ /usr/bin/perl ${SWATCHDOG_SCRIPT} 1>/dev/null
+ eend $?
+}
+
+start() {
+ checkpath -d -q -m 0750 -o root:root /run/swatchdog
+ if [ "${PARSE_FULL}" == "YES" ]; then
+ parse_full
+ fi
+ gen_script --tail-file
+ ebegin "Starting swatchdog"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile /run/swatchdog/swatchdog.pid \
+ --stdout ${SWATCHDOG_LOGFILE} --stderr ${SWATCHDOG_ERRFILE} \
+ --exec /usr/bin/perl -- ${SWATCHDOG_SCRIPT}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping swatchdog"
+ start-stop-daemon --stop --exec /usr/bin/perl \
+ --pidfile /run/swatchdog/swatchdog.pid --quiet
+ eend $?
+}
diff --git a/app-admin/swatchdog/files/swatchdogrc b/app-admin/swatchdog/files/swatchdogrc
new file mode 100644
index 000000000000..5132f855852b
--- /dev/null
+++ b/app-admin/swatchdog/files/swatchdogrc
@@ -0,0 +1,10 @@
+#
+# A sample configuration file for swatchdog.
+#
+# See "man swatchdog" for details.
+
+# Mails root when invalid remote login attempted.
+watchfor /(.*) (.*) (.*) (.*) (.*):( [iI]nvalid [uU]ser )(.*)( from )(.*)$/
+ threshold track_by=$9,type=limit,count=3,seconds=30
+ mail root,subject="Invalid user"
+
diff --git a/app-admin/swatchdog/metadata.xml b/app-admin/swatchdog/metadata.xml
new file mode 100644
index 000000000000..4ed3356aa206
--- /dev/null
+++ b/app-admin/swatchdog/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>nimiux@gentoo.org</email>
+ <name>Chema Alonso</name>
+ </maintainer>
+ <longdescription lang="en">
+ swatchdog.pl started out as swatch, the "simple watchdog"
+ for activity monitoring log files produced by UNIX's syslog
+ facility. It has since been evolving into a utility that can
+ monitor just about any type of log. The name has been changed
+ to satisfy a request made by the old Swiss watch company.
+ </longdescription>
+ <longdescription lang="es">
+ swatchdog.pl comenzó como swatch, el "simple perro guardián"
+ para monitorizar la actividad en los ficheros de registro
+ producidos por la característica syslog de los sistemas UNIX.
+ Desde entonces ha evolucionado hacia una utilidad que puede
+ monitorizar cualquier tipo de registro. Se ha cambiado el
+ nombre del proyecto para satisfacer una petición realizada
+ por la empresa de relojes suiza.
+ </longdescription>
+</pkgmetadata>
diff --git a/app-admin/swatchdog/swatchdog-3.2.4.ebuild b/app-admin/swatchdog/swatchdog-3.2.4.ebuild
new file mode 100644
index 000000000000..a5a3fe7c08d4
--- /dev/null
+++ b/app-admin/swatchdog/swatchdog-3.2.4.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+GENTOO_DEPEND_ON_PERL_SUBSLOT=yes
+inherit perl-app
+
+DESCRIPTION="Simple log watcher"
+HOMEPAGE="https://sourceforge.net/projects/swatch/"
+SRC_URI="mirror://sourceforge/swatch/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="dev-perl/Date-Manip
+ dev-perl/Date-Calc
+ dev-perl/File-Tail
+ dev-perl/TimeDate
+ >=virtual/perl-Time-HiRes-1.12
+ !app-admin/swatch"
+
+src_install() {
+ emake install
+ newinitd "${FILESDIR}/${PN}-init" "${PN}"
+ newconfd "${FILESDIR}/${PN}-confd" "${PN}"
+ insinto /etc
+ doins "${FILESDIR}/${PN}rc"
+}