From dc0e06de2cf81067990469669de4ad7fc5816f6b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 30 Aug 2001 20:07:28 +0000 Subject: [PATCH] 3906af844fd242b9791a46cfc1e24068 fwlogwatch.sysconfig b18fdae11d1fca9fd0f8493a9eb4c0a6 fwlogwatch.init dea18b8fc4b0183f437fc54d65e0601b fwlogwatch-config.patch 225582addf8b93925c8608d590883777 fwlogwatch-DESTDIR.patch Changed files: fwlogwatch-DESTDIR.patch -> 1.1 fwlogwatch-config.patch -> 1.1 fwlogwatch.init -> 1.1 fwlogwatch.sysconfig -> 1.1 --- fwlogwatch-DESTDIR.patch | 71 ++++++++++++++++++++++++++++++++++++++++ fwlogwatch-config.patch | 32 ++++++++++++++++++ fwlogwatch.init | 60 +++++++++++++++++++++++++++++++++ fwlogwatch.sysconfig | 7 ++++ 4 files changed, 170 insertions(+) create mode 100644 fwlogwatch-DESTDIR.patch create mode 100644 fwlogwatch-config.patch create mode 100644 fwlogwatch.init create mode 100644 fwlogwatch.sysconfig diff --git a/fwlogwatch-DESTDIR.patch b/fwlogwatch-DESTDIR.patch new file mode 100644 index 0000000..cd23840 --- /dev/null +++ b/fwlogwatch-DESTDIR.patch @@ -0,0 +1,71 @@ +diff -urN fwlogwatch-0.4.org/Makefile fwlogwatch-0.4/Makefile +--- fwlogwatch-0.4.org/Makefile Thu Aug 30 14:00:03 2001 ++++ fwlogwatch-0.4/Makefile Thu Aug 30 14:45:50 2001 +@@ -1,8 +1,13 @@ + # $Id$ + ++PREFIX=/usr ++SBINDIR=$(PREFIX)/sbin ++MANDIR=$(PREFIX)/man ++SYSCONFDIR=/etc ++ + # Linux + CC = gcc +-CFLAGS = -pipe -O2 -Wall #-pedantic #-g #-p ++CFLAGS = $(OPT) -pipe -Wall -DSYSCONFDIR=\"$(SYSCONFDIR)\" + LDFLAGS = #-g #-static -p + LIBS = -lcrypt -lz #-lc_p + +@@ -66,14 +71,14 @@ + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) + + install: all +- $(INSTALL_PROGRAM) fwlogwatch /usr/local/sbin/fwlogwatch +- $(INSTALL_SCRIPT) contrib/fwlw_notify /usr/local/sbin/fwlw_notify +- $(INSTALL_SCRIPT) contrib/fwlw_respond /usr/local/sbin/fwlw_respond +- $(INSTALL_DATA) fwlogwatch.8 /usr/local/man/man8/fwlogwatch.8 ++ $(INSTALL_PROGRAM) fwlogwatch $(DESTDIR)$(SBINDIR)/fwlogwatch ++ $(INSTALL_SCRIPT) contrib/fwlw_notify $(DESTDIR)$(SYSCONFDIR)/fwlw_notify ++ $(INSTALL_SCRIPT) contrib/fwlw_respond $(DESTDIR)$(SYSCONFDIR)/fwlw_respond ++ $(INSTALL_DATA) fwlogwatch.8 $(DESTDIR)$(MANDIR)/man8/fwlogwatch.8 + + install-config: +- $(INSTALL_DATA) fwlogwatch.config /etc/fwlogwatch.config +- $(INSTALL_DATA) fwlogwatch.template /etc/fwlogwatch.template ++ $(INSTALL_DATA) fwlogwatch.config $(DESTDIR)$(SYSCONFDIR)/fwlogwatch.config ++ $(INSTALL_DATA) fwlogwatch.template $(DESTDIR)$(SYSCONFDIR)/fwlogwatch.template + + uninstall: + @rm -f /usr/local/sbin/fwlogwatch \ +diff -urN fwlogwatch-0.4.org/main.h fwlogwatch-0.4/main.h +--- fwlogwatch-0.4.org/main.h Thu Aug 30 14:00:03 2001 ++++ fwlogwatch-0.4/main.h Thu Aug 30 14:45:05 2001 +@@ -32,7 +32,7 @@ + /* Files */ + + #define INFILE "/var/log/messages" +-#define RCFILE "/etc/fwlogwatch.config" ++#define RCFILE SYSCONFDIR "/fwlogwatch.config" + + /* Modes */ + +@@ -187,7 +187,7 @@ + /* Interactive report mode */ + + #define CERT "[Insert address of abuse contact or CERT here]" +-#define TEMPLATE "/etc/fwlogwatch.template" ++#define TEMPLATE SYSCONFDIR "/fwlogwatch.template" + #define FILENAME "fwlogwatchXXXXXX" + #define INSERTREPORT "# insert report here" + #define P_CAT "/bin/cat" +@@ -203,8 +203,8 @@ + + #define ALERT 5 + #define FORGET 86400 +-#define FWLW_NOTIFY "/usr/local/sbin/fwlw_notify" +-#define FWLW_RESPOND "/usr/local/sbin/fwlw_respond" ++#define FWLW_NOTIFY SYSCONFDIR "/fwlw_notify" ++#define FWLW_RESPOND SYSCONFDIR "/fwlw_respond" + #define LISTENIF "127.0.0.1" + #define LISTENPORT 888 + #define DEFAULT_USER "admin" diff --git a/fwlogwatch-config.patch b/fwlogwatch-config.patch new file mode 100644 index 0000000..20db6bd --- /dev/null +++ b/fwlogwatch-config.patch @@ -0,0 +1,32 @@ +diff -urN fwlogwatch-0.4.org/fwlogwatch.config fwlogwatch-0.4/fwlogwatch.config +--- fwlogwatch-0.4.org/fwlogwatch.config Thu Aug 30 14:00:03 2001 ++++ fwlogwatch-0.4/fwlogwatch.config Thu Aug 30 15:20:44 2001 +@@ -24,7 +24,7 @@ + # files (gzip) are supported. + # Command line option: -f + # +-#input = ++input = /var/log/kernel + + + ### Evaluation options ### +@@ -202,7 +202,7 @@ + # Use 'realtime_response' to turn this mode on. + # Command line option: -R + # +-#realtime_response ++realtime_response + + # With the 'pidfile' option you can specify a file fwlogwatch will use to + # keep it's PID so it can receive signals from scripts. +@@ -227,8 +227,8 @@ + # respectively are specified here. + # Command line options: -A / -B + # +-#notify +-#respond ++notify ++respond + + # Known hosts are those that will not be warned about or actions taken + # against, even if they match the alert/response criteria. diff --git a/fwlogwatch.init b/fwlogwatch.init new file mode 100644 index 0000000..3324f52 --- /dev/null +++ b/fwlogwatch.init @@ -0,0 +1,60 @@ +#!/bin/sh +# +# fwlogwatchd Firewall log analyzer +# +# chkconfig: 345 85 15 +# description: Firewall log analyzer and raport generator tool# + +# Source function library +. /etc/rc.d/init.d/functions + +# Get service config +[ -f /etc/sysconfig/fwlogwatch ] && . /etc/sysconfig/fwlogwatch + +# See how we were called. +case "$1" in + start) + # Check if the service is already running? + if [ ! -f /var/lock/subsys/fwlogwatch ]; then + msg_starting fwlogwatch + daemon fwlogwatch $FWLOGWATCH_OPTS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fwlogwatch + else + msg_Already_Running fwlogwatch + exit 1 + fi + ;; + stop) + # Stop daemons. + if [ -f /var/lock/subsys/fwlogwatch ]; then + msg_stopping fwlogwatch + killproc fwlogwatch + rm -f /var/lock/subsys/fwlogwatch > /dev/null 2>&1 + else + msg_Not_Running fwlogwatch + exit 1 + fi + ;; + status) + status fwlogwatch + RETVAL=$? + exit $RETVAL + ;; + restart) + $0 stop + $0 start + ;; + reload) + msg_reloading fwlogwatch + killproc fwlogwatch -HUP + RETVAL=$? + ;; + *) + msg_Usage "$0 {start|stop|restart|status}" + exit 1 + ;; +esac + +exit $RETVAL + diff --git a/fwlogwatch.sysconfig b/fwlogwatch.sysconfig new file mode 100644 index 0000000..a186f27 --- /dev/null +++ b/fwlogwatch.sysconfig @@ -0,0 +1,7 @@ +# sysconfig for fwlogwatch + +# Define nice level for nscd +SERVICE_RUN_NICE_LEVEL="+0" + +FWLOGWATCH_OPTS="" + -- 2.44.0