From: Victor Martinez Date: Wed, 15 Feb 2017 00:13:55 +0000 (+0000) Subject: sysklogd: updated to 1.5.1 X-Git-Url: http://gitweb/?a=commitdiff_plain;h=3627dae34e178f4490e095d434aa1509cbac91b7;p=crossrootfs.git sysklogd: updated to 1.5.1 --- diff --git a/sysklogd/.md5sum b/sysklogd/.md5sum index 83f4b8a..ab0b2d2 100644 --- a/sysklogd/.md5sum +++ b/sysklogd/.md5sum @@ -1,5 +1,6 @@ -b379693c8b89c99994e58efd49f98a71 rotatelog -30b06790cf14ecf843392aba05610b7f sysklogd +41dfad9077311e159c793216adf90723 rotatelog +b34c927b05f072083d801deba5420e80 sysklogd c70599ab0d037fde724f7210c2c8d7f8 sysklogd-1.5.1.tar.gz -bf5c13b44ab9fa15cda9bfa9df9b584e syslog -022ca2758664748ae096d57eac9ac555 syslog.conf +f713765b6840ee73733ff58120de52f5 sysklogd.diff +844e5e75944beb8cf4f39a0535e56ba4 syslog +f8d478b8d60c1d3879f4a10a955db6e5 syslog.conf diff --git a/sysklogd/Pkgfile b/sysklogd/Pkgfile index 96cea88..778cf07 100644 --- a/sysklogd/Pkgfile +++ b/sysklogd/Pkgfile @@ -8,18 +8,17 @@ name=sysklogd version=1.5.1 release=3 source=(http://www.infodrom.org/projects/$name/download/$name-$version.tar.gz \ - rotatelog syslog syslog.conf sysklogd) + rotatelog syslog syslog.conf sysklogd sysklogd.diff) build() { cd $name-$version - # don't try to fclose(NULL) - sed -i -e '192d' ksym_mod.c + patch -p1 -i $SRC/sysklogd.diff - mkdir -p $PKG/usr/sbin \ - $PKG/etc/{cron/weekly,rc.d} \ - $PKG/var/log \ - $PKG/usr/share/man/{man5,man8} + install -d $PKG/usr/sbin \ + $PKG/etc/{cron/weekly,rc.d} \ + $PKG/var/log \ + $PKG/usr/share/man/{man5,man8} # no strip sysklogd and klogd binaries sed -e 's|${INSTALL} -m 500 -s|${INSTALL} -m 500|' -i Makefile diff --git a/sysklogd/rotatelog b/sysklogd/rotatelog index 7ecb623..3e790a7 100755 --- a/sysklogd/rotatelog +++ b/sysklogd/rotatelog @@ -22,6 +22,6 @@ fi [ -f /var/log/old/$1.3 ] && mv /var/log/old/$1.3 /var/log/old/$1.4 [ -f /var/log/old/$1.2 ] && mv /var/log/old/$1.2 /var/log/old/$1.3 [ -f /var/log/old/$1.1 ] && mv /var/log/old/$1.1 /var/log/old/$1.2 -[ -f /var/log/$1 ] && (cp /var/log/$1 /var/log/old/$1.1; echo -n "" > /var/log/$1) +[ -f /var/log/$1 ] && (cp /var/log/$1 /var/log/old/$1.1 && echo -n "" > /var/log/$1) # End of file diff --git a/sysklogd/sysklogd b/sysklogd/sysklogd index d14870c..90a0835 100644 --- a/sysklogd/sysklogd +++ b/sysklogd/sysklogd @@ -1,23 +1,45 @@ #!/bin/sh # -# /etc/rc.d/sysklogd: start/stop sysklogd logging daemons +# /etc/rc.d/sysklogd: start/stop syslog and klog daemons # +SSD=/sbin/start-stop-daemon +SLOG=/usr/sbin/syslogd +KLOG=/usr/sbin/klogd +SLOG_PID=/var/run/syslogd.pid +KLOG_PID=/var/run/klogd.pid + + +print_status() { + $SSD --status --pidfile $2 + case $? in + 0) echo "$1 is running with pid $(cat $2)" ;; + 1) echo "$1 is not running but the pid file $2 exists" ;; + 3) echo "$1 is not running" ;; + 4) echo "Unable to determine the program status" ;; + esac +} + case $1 in start) - /usr/sbin/syslogd - /usr/sbin/klogd -c 3 + $SSD --start --pidfile $SLOG_PID --exec $SLOG + $SSD --start --pidfile $KLOG_PID --exec $KLOG -- -c4 ;; stop) - /usr/bin/killall syslogd - /usr/bin/killall klogd + $SSD --stop --retry 10 --pidfile $SLOG_PID + $SSD --stop --retry 10 --pidfile $KLOG_PID ;; restart) $0 stop - sleep 2 $0 start ;; +status) + print_status $SLOG $SLOG_PID + print_status $KLOG $KLOG_PID + ;; *) - echo "usage: $0 [start|stop|restart]" + echo "usage: $0 [start|stop|restart|status]" ;; esac + +# End of file diff --git a/sysklogd/sysklogd.diff b/sysklogd/sysklogd.diff new file mode 100644 index 0000000..105eeef --- /dev/null +++ b/sysklogd/sysklogd.diff @@ -0,0 +1,36 @@ +diff -Nru sysklogd-1.5.1.orig/Makefile sysklogd-1.5.1/Makefile +--- sysklogd-1.5.1.orig/Makefile 2016-08-27 17:05:36.783075199 +0200 ++++ sysklogd-1.5.1/Makefile 2016-08-27 17:05:52.512526347 +0200 +@@ -20,7 +20,8 @@ + CC= gcc + #SKFLAGS= -g -DSYSV -Wall + #LDFLAGS= -g +-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce ++RPM_OPT_FLAGS ?= -O2 ++SKFLAGS= $(RPM_OPT_FLAGS) -DSYSV -Wall + # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE + # $(shell getconf LFS_SKFLAGS) +diff -Nru sysklogd-1.5.1.orig/ksym_mod.c sysklogd-1.5.1/ksym_mod.c +--- sysklogd-1.5.1.orig/ksym_mod.c 2016-08-27 17:05:36.783075199 +0200 ++++ sysklogd-1.5.1/ksym_mod.c 2016-08-27 17:05:52.512526347 +0200 +@@ -189,7 +189,6 @@ + else + Syslog(LOG_ERR, "Error loading kernel symbols " \ + "- %s\n", strerror(errno)); +- fclose(ksyms); + return(0); + } + +diff -Nru sysklogd-1.5.1.orig/syslogd.c sysklogd-1.5.1/syslogd.c +--- sysklogd-1.5.1.orig/syslogd.c 2016-08-27 17:05:36.783075199 +0200 ++++ sysklogd-1.5.1/syslogd.c 2016-08-27 17:08:12.964223932 +0200 +@@ -2094,7 +2094,7 @@ + (void) signal(SIGCHLD, reapchild); /* reset signal handler -ASP */ + wait ((int *)0); + #else +- union wait status; ++ int status; + + while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0) + ; diff --git a/sysklogd/syslog b/sysklogd/syslog index 89f71c4..5da248d 100755 --- a/sysklogd/syslog +++ b/sysklogd/syslog @@ -3,8 +3,10 @@ # /etc/cron/weekly/syslog: rotate log files # -/usr/sbin/rotatelog cron /usr/sbin/rotatelog auth +/usr/sbin/rotatelog cron +/usr/sbin/rotatelog debug +/usr/sbin/rotatelog kernel /usr/sbin/rotatelog mail /usr/sbin/rotatelog messages diff --git a/sysklogd/syslog.conf b/sysklogd/syslog.conf index 4222a1b..1851b98 100644 --- a/sysklogd/syslog.conf +++ b/sysklogd/syslog.conf @@ -2,9 +2,12 @@ # /etc/syslog.conf # -*.emerg * -authpriv.*;auth.* /var/log/auth -mail.* -/var/log/mail -*.info;authpriv,auth,mail.none /var/log/messages +*.emerg * +kern.* /var/log/kernel +authpriv,auth.info /var/log/auth +mail.info /var/log/mail +cron.info /var/log/cron +*.info;authpriv,auth,mail,cron,kern.none /var/log/messages +*.=debug;kern.none /var/log/debug # End of file