summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé María Alonso <nimiux@gentoo.org>2013-01-07 16:42:42 +0000
committerJosé María Alonso <nimiux@gentoo.org>2013-01-07 16:42:42 +0000
commit988342bb5be2735c02fc0cdb55ef75cb6d4e5ea7 (patch)
tree6ae00d5cf47839278c4ec208e14ec1948ce132f3 /app-admin/swatch
parentapp-office/texstudio: Version Bump (diff)
downloadgentoo-2-988342bb5be2735c02fc0cdb55ef75cb6d4e5ea7.tar.gz
gentoo-2-988342bb5be2735c02fc0cdb55ef75cb6d4e5ea7.tar.bz2
gentoo-2-988342bb5be2735c02fc0cdb55ef75cb6d4e5ea7.zip
Fix keepdir /var/run wrt bug #449986. Include sample configuration file.
(Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key D628E536)
Diffstat (limited to 'app-admin/swatch')
-rw-r--r--app-admin/swatch/ChangeLog9
-rw-r--r--app-admin/swatch/files/swatch-init53
-rw-r--r--app-admin/swatch/files/swatchrc10
-rw-r--r--app-admin/swatch/swatch-3.2.3-r2.ebuild32
4 files changed, 103 insertions, 1 deletions
diff --git a/app-admin/swatch/ChangeLog b/app-admin/swatch/ChangeLog
index 3886f99bd909..ff681ff7dc19 100644
--- a/app-admin/swatch/ChangeLog
+++ b/app-admin/swatch/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-admin/swatch
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/swatch/ChangeLog,v 1.28 2013/01/05 18:51:20 nimiux Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/swatch/ChangeLog,v 1.29 2013/01/07 16:42:42 nimiux Exp $
+
+*swatch-3.2.3-r2 (07 Jan 2013)
+
+ 07 Jan 2013; Chema Alonso <nimiux@gentoo.org> +swatch-3.2.3-r2.ebuild,
+ +files/swatch-init, +files/swatchrc:
+ Revision bump to fix keepdir /var/run wrt bug #449986 and include sample
+ swatchrc file.
05 Jan 2013; Chema Alonso <nimiux@gentoo.org> metadata.xml:
Add longdescription to metadata
diff --git a/app-admin/swatch/files/swatch-init b/app-admin/swatch/files/swatch-init
new file mode 100644
index 000000000000..cd622de5e59d
--- /dev/null
+++ b/app-admin/swatch/files/swatch-init
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# This script is based on the one created by Phil (bug #255329).
+
+depend() {
+ need logger
+}
+
+SWATCH_BINARY=${SWATCH_BINARY:-/usr/bin/swatch}
+SWATCHRC=${SWATCHRC:-/etc/swatchrc}
+SWATCH_TAILFILE=${SWATCH_TAILFILE:-/var/log/syslog}
+SWATCH_LOGFILE=${SWATCH_LOGFILE:-/var/log/swatch.log}
+SWATCH_ERRFILE=${SWATCH_ERRFILE:-/var/log/swatch-err.log}
+SWATCH_SCRIPT=${SWATCH_SCRIPT:-/var/run/swatch/swatch_script.pl}
+
+gen_script() {
+ local tailargs=""
+ if [ "${SWATCH_TAILARGS}" ]; then
+ tailargs="--tail-args=\"${SWATCH_TAILARGS}\""
+ fi
+ ebegin "Generating swatch script from config"
+ ${SWATCH_BINARY} --dump-script="${SWATCH_SCRIPT}" \
+ --use-cpan-file-tail ${tailargs} \
+ --config-file "${SWATCHRC}" $1 "${SWATCH_TAILFILE}"
+ eend $?
+}
+
+parse_full() {
+ gen_script --examine
+ ebegin "Parsing complete file once"
+ /usr/bin/perl ${SWATCH_SCRIPT} 1>/dev/null
+ eend $?
+}
+
+start() {
+ checkpath -d -q -m 0750 -o root:root /var/run/swatch
+ if [ "${PARSE_FULL}" == "YES" ]; then
+ parse_full
+ fi
+ gen_script --tail-file
+ ebegin "Starting swatch"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile /var/run/swatch/swatch.pid \
+ --stdout ${SWATCH_LOGFILE} --stderr ${SWATCH_ERRFILE} \
+ --exec /usr/bin/perl -- ${SWATCH_SCRIPT}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping swatch"
+ start-stop-daemon --stop --exec /usr/bin/perl \
+ --pidfile /var/run/swatch/swatch.pid --quiet
+ eend $?
+}
diff --git a/app-admin/swatch/files/swatchrc b/app-admin/swatch/files/swatchrc
new file mode 100644
index 000000000000..92e88ded1ef5
--- /dev/null
+++ b/app-admin/swatch/files/swatchrc
@@ -0,0 +1,10 @@
+#
+# A sample configuration file for swatch.
+#
+# See "man swatch" 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/swatch/swatch-3.2.3-r2.ebuild b/app-admin/swatch/swatch-3.2.3-r2.ebuild
new file mode 100644
index 000000000000..40825e701a33
--- /dev/null
+++ b/app-admin/swatch/swatch-3.2.3-r2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/swatch/swatch-3.2.3-r2.ebuild,v 1.1 2013/01/07 16:42:42 nimiux Exp $
+
+EAPI=5
+
+inherit perl-app
+
+DESCRIPTION="Perl-based system log watcher"
+HOMEPAGE="http://sourceforge.net/projects/swatch/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-perl/DateManip
+ dev-perl/Date-Calc
+ dev-perl/File-Tail
+ dev-perl/TimeDate
+ >=virtual/perl-Time-HiRes-1.12
+"
+
+src_install() {
+ emake install
+ newinitd "${FILESDIR}/${PN}-init" "${PN}"
+ newconfd "${FILESDIR}/${PN}-confd" "${PN}"
+ insinto /etc
+ doins "${FILESDIR}/swatchrc"
+}