summaryrefslogtreecommitdiffstats
path: root/source/a/sysklogd
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/sysklogd')
-rw-r--r--source/a/sysklogd/config/rc.syslog.new23
-rwxr-xr-xsource/a/sysklogd/sysklogd.SlackBuild9
-rw-r--r--source/a/sysklogd/sysklogd.allow.repeated.messages.diff69
3 files changed, 92 insertions, 9 deletions
diff --git a/source/a/sysklogd/config/rc.syslog.new b/source/a/sysklogd/config/rc.syslog.new
index 46208fab8..f2b51d5eb 100644
--- a/source/a/sysklogd/config/rc.syslog.new
+++ b/source/a/sysklogd/config/rc.syslog.new
@@ -3,11 +3,21 @@
#
# Written for Slackware Linux by Patrick J. Volkerding <volkerdi@slackware.com>.
+# Uncomment the following line to use the -c option to syslogd. This will
+# disable suppressing repeated messages, which may be useful with tools that
+# parse the logs, such as fail2ban:
+#SYSLOGD_OPTIONS="-c "
+
+# Options for klogd:
+# '-c 3' = display level 'error' or higher messages on console
+# '-x' = turn off broken EIP translation
+KLOGD_OPTIONS="-c 3 -x"
+
syslogd_start() {
if [ -x /usr/sbin/syslogd -a -x /usr/sbin/klogd ]; then
echo -n "Starting sysklogd daemons: "
- echo -n "/usr/sbin/syslogd "
- /usr/sbin/syslogd
+ echo -n "/usr/sbin/syslogd ${SYSLOGD_OPTIONS};"
+ /usr/sbin/syslogd $SYSLOGD_OPTIONS
# prevent syslogd/klogd race condition on SMP kernels
if ps acx | grep -q udevd ; then
while [ ! -e /dev/log ] ; do
@@ -16,10 +26,11 @@ syslogd_start() {
else
sleep 1
fi
- echo "/usr/sbin/klogd -c 3 -x"
- # '-c 3' = display level 'error' or higher messages on console
- # '-x' = turn off broken EIP translation
- /usr/sbin/klogd -c 3 -x
+ # Run klogd, unless we are in a container:
+ if [ -z $container ]; then
+ echo " /usr/sbin/klogd $KLOGD_OPTIONS"
+ /usr/sbin/klogd $KLOGD_OPTIONS
+ fi
fi
}
diff --git a/source/a/sysklogd/sysklogd.SlackBuild b/source/a/sysklogd/sysklogd.SlackBuild
index 8ff3de9d2..b4b83f869 100755
--- a/source/a/sysklogd/sysklogd.SlackBuild
+++ b/source/a/sysklogd/sysklogd.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,12 +21,12 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=1.5
+VERSION=1.5.1
BUILD=${BUILD:-2}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
*) export ARCH=$( uname -m ) ;;
esac
@@ -54,6 +54,9 @@ find . \
# Use memmove() instead of strcpy() in syslogd.c
zcat $CWD/use_memmove_not_strcpy.diff.gz | patch -p1 --verbose || exit 1
+# Allow -c option to log all (even repeated) messages:
+zcat $CWD/sysklogd.allow.repeated.messages.diff.gz | patch -p1 --verbose || exit 1
+
make all syslog_tst $NUMJOBS || make || exit 1
mkdir -p $PKG/usr/sbin
diff --git a/source/a/sysklogd/sysklogd.allow.repeated.messages.diff b/source/a/sysklogd/sysklogd.allow.repeated.messages.diff
new file mode 100644
index 000000000..41e6bf15d
--- /dev/null
+++ b/source/a/sysklogd/sysklogd.allow.repeated.messages.diff
@@ -0,0 +1,69 @@
+--- ./syslogd.c.orig 2014-10-04 14:47:18.000000000 -0500
++++ ./syslogd.c 2016-06-29 01:46:39.355541929 -0500
+@@ -776,6 +776,7 @@
+ };
+
+ int Debug; /* debug flag */
++int Compress = 1; /* compress repeated messages flag */
+ char LocalHostName[MAXHOSTNAMELEN+1]; /* our hostname */
+ char *LocalDomain; /* our local domain name */
+ char *emptystring = "";
+@@ -888,7 +889,7 @@
+ funix[i] = -1;
+ }
+
+- while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
++ while ((ch = getopt(argc, argv, "a:cdhf:l:m:np:rs:v")) != EOF)
+ switch((char)ch) {
+ case 'a':
+ if (nfunix < MAXFUNIX)
+@@ -896,6 +897,9 @@
+ else
+ fprintf(stderr, "Out of descriptors, ignoring %s\n", optarg);
+ break;
++ case 'c': /* don't compress repeated messages */
++ Compress = 0;
++ break;
+ case 'd': /* debug */
+ Debug = 1;
+ break;
+@@ -1240,7 +1244,7 @@
+
+ int usage()
+ {
+- fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
++ fprintf(stderr, "usage: syslogd [-cdrvh] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
+ " [-s domainlist] [-f conffile]\n");
+ exit(1);
+ }
+@@ -1703,7 +1707,7 @@
+ /*
+ * suppress duplicate lines to this file
+ */
+- if ((flags & MARK) == 0 && msglen == f->f_prevlen &&
++ if (Compress && (flags & MARK) == 0 && msglen == f->f_prevlen &&
+ !strcmp(msg, f->f_prevline) &&
+ !strcmp(from, f->f_prevhost)) {
+ (void) strncpy(f->f_lasttime, timestamp, 15);
+--- ./sysklogd.8.orig 2014-10-04 14:47:18.000000000 -0500
++++ ./sysklogd.8 2016-06-29 01:59:45.311525189 -0500
+@@ -10,6 +10,7 @@
+ .RB [ " \-a "
+ .I socket
+ ]
++.RB [ " \-c " ]
+ .RB [ " \-d " ]
+ .RB [ " \-f "
+ .I config file
+@@ -83,6 +84,11 @@
+ described by the people from OpenBSD at
+ <http://www.guides.sk/psionic/dns/>.
+ .TP
++.B "\-c"
++Disable the repeating line compression that normally suppresses the
++repeated lines and logs a message such as 'last message repeated 124
++times'. With this option, all repeated lines will be logged.
++.TP
+ .B "\-d"
+ Turns on debug mode. Using this the daemon will not proceed a
+ .BR fork (2)