diff --git a/Makefile b/Makefile index 354f154..7ad54f1 100644 --- a/Makefile +++ b/Makefile @@ -62,14 +62,14 @@ # of the package. ARCH = x86_64 -DEPENDS = e2fsprogs,glibc,gmp,krb5,libgnutls,libnettle,zlib +DEPENDS = e2fsprogs,glibc,gmp,krb5,libgnutls,libnettle,logrotate,zlib BUILDDEPS = SRCPKG = URL = https://www.rsyslog.com/ REPO = main BRIEF = RSYSLOG is the rocket-fast system for log processing DESC = RSYSLOG is the rocket-fast system for log processing -SNAPVER = 0 +SNAPVER = 1 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') @@ -133,6 +133,8 @@ $(ROOT): $(SRCDIR)/tools/rsyslogd install -v -d -m 0755 $(ROOT)/var/spool/rsyslog && \ install -v -m 0644 $(SNAPDIR)/rsyslog.conf \ $(ROOT)/usr/share/$(PACKAGE)/rsyslog.conf && \ + install -v -m 0644 $(SNAPDIR)/rsyslog.logrotate \ + $(ROOT)/usr/share/$(PACKAGE)/rsyslog.logrotate && \ install -v -m 0755 $(SNAPDIR)/rsyslog.init \ $(ROOT)/etc/init.d/rsyslog diff --git a/SNAP/rsyslog.logrotate b/SNAP/rsyslog.logrotate new file mode 100644 index 0000000..d75287c --- /dev/null +++ b/SNAP/rsyslog.logrotate @@ -0,0 +1,37 @@ +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + invoke-rc.d rsyslog rotate > /dev/null + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + invoke-rc.d rsyslog rotate > /dev/null + endscript +} diff --git a/SNAP/usher b/SNAP/usher index 81a1ed6..6655cee 100755 --- a/SNAP/usher +++ b/SNAP/usher @@ -11,6 +11,10 @@ case $1 in cp /usr/share/rsyslog/rsyslog.conf /etc/rsyslog.conf fi + if [ ! -f /etc/logrotate.d/rsyslog ]; then + cp /usr/share/rsyslog/rsyslog.logrotate /etc/logrotate.d/rsyslog + fi + /etc/init.d/rsyslog status 2>&1 > /dev/null && /etc/init.d/rsyslog restart exit 0