From d429e1abbd1bad14df32a2a39826a6631fd8c19a Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Sat, 6 Jan 2024 06:27:37 +0100 Subject: [PATCH] automatic version update by autodist [release 3.8.7-1mamba;Sat Oct 19 2013] --- README.md | 7 +++ logrotate-init | 35 +++++++++++++ logrotate.conf | 30 +++++++++++ logrotate.cron | 3 ++ logrotate.spec | 139 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 logrotate-init create mode 100644 logrotate.conf create mode 100644 logrotate.cron create mode 100644 logrotate.spec diff --git a/README.md b/README.md index 142e12b..7e0c06c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # logrotate +The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. +Logrotate allows for the automatic rotation compression, removal and mailing of log files. +Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. +Normally, logrotate runs as a daily cron job and once at boot time. + +Install the logrotate package if you need a utility to deal with the log files on your system. + diff --git a/logrotate-init b/logrotate-init new file mode 100644 index 0000000..0370784 --- /dev/null +++ b/logrotate-init @@ -0,0 +1,35 @@ +#!/bin/sh +# +# logrotate - launches logrotate at boot time to ensure logs are rotated on machine that are +# usually not up when the cron job would be executed +# +# chkconfig: 2345 99 01 +# description: launches logrotate at boot time to ensure logs are rotated on machine that are +# usually not up when the cron job would be executed +# +. /etc/sysconfig/rc +. $rc_functions + +NAME=logrotate +DAEMON=/usr/sbin/$NAME +DAEMONPID=/var/run/$NAME.pid +DAEMONLOCK=/var/lock/subsys/$NAME +OPTIONS=/etc/logrotate.conf + +[ -x $DAEMON ] || exit 0 + +[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME + +case "$1" in + start) + echo -n $"Starting"" $NAME: " + daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS + echo + ;; + stop) + ;; + *) + echo $"Usage: ""/etc/init.d/$NAME {start}" + exit 1 + ;; +esac diff --git a/logrotate.conf b/logrotate.conf new file mode 100644 index 0000000..7815706 --- /dev/null +++ b/logrotate.conf @@ -0,0 +1,30 @@ +# see "man logrotate" for details +# rotate log files weekly +weekly + +# keep 4 weeks worth of backlogs +rotate 4 + +# create new (empty) log files after rotating old ones +create + +# uncomment this if you want your log files compressed +compress + +# RPM packages drop log rotation information into this directory +include /etc/logrotate.d + +# no packages own lastlog or wtmp -- we'll rotate them here +/var/log/wtmp { + monthly + create 0664 root utmp + rotate 1 + nocompress +} + +/var/log/lastlog { + monthly + rotate 1 +} + +# system-specific logs may be configured here diff --git a/logrotate.cron b/logrotate.cron new file mode 100644 index 0000000..e8ab921 --- /dev/null +++ b/logrotate.cron @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/sbin/logrotate /etc/logrotate.conf diff --git a/logrotate.spec b/logrotate.spec new file mode 100644 index 0000000..17f362b --- /dev/null +++ b/logrotate.spec @@ -0,0 +1,139 @@ +Name: logrotate +Version: 3.8.7 +Release: 1mamba +Summary: Rotates, compresses, removes and mails system log files +Group: System/Tools +Vendor: openmamba +Distribution: openmamba +Packager: Davide Madrisan +URL: ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS +Source0: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{version}.tar.gz +Source1: %{name}.conf +Source2: %{name}.cron +Source3: %{name}-init +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libpopt-devel +BuildRequires: libselinux-devel +## AUTOBUILDREQ-END +Requires(pre): initscripts +Requires(post):chkconfig +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. +Logrotate allows for the automatic rotation compression, removal and mailing of log files. +Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. +Normally, logrotate runs as a daily cron job and once at boot time. + +Install the logrotate package if you need a utility to deal with the log files on your system. + +%prep +%setup -q + +%build +%make WITH_SELINUX=yes CC=%{_host}-gcc + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +make install PREFIX=%{buildroot} MANDIR=%{_mandir} + +install -D -m 644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.conf +install -D -m 755 %{S:2} %{buildroot}%{_sysconfdir}/cron.daily/logrotate +install -D -m 744 %{S:3} %{buildroot}%{_initrddir}/logrotate +install -d %{buildroot}%{_sysconfdir}/logrotate.d/ +install -d %{buildroot}/var/lib +touch %{buildroot}/var/lib/logrotate.status + +%post +if [ $1 -ge 1 ]; then +# new install + chkconfig --add logrotate +fi +exit 0 + +%preun +if [ $1 -eq 0 ]; then +# erase + chkconfig --del logrotate +fi +exit 0 + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_sbindir}/logrotate +%dir %{_sysconfdir}/logrotate.d +%{_sysconfdir}/cron.daily/logrotate +%config(noreplace) %{_sysconfdir}/logrotate.conf +%config(noreplace) %{_localstatedir}/lib/logrotate.status +%{_initrddir}/logrotate +%{_mandir}/man5/* +%{_mandir}/man8/* + +%changelog +* Sat Oct 19 2013 Automatic Build System 3.8.7-1mamba +- automatic version update by autodist + +* Mon Aug 12 2013 Automatic Build System 3.8.6-1mamba +- automatic update by autodist + +* Thu Jun 13 2013 Automatic Build System 3.8.5-1mamba +- automatic version update by autodist + +* Fri May 03 2013 Automatic Build System 3.8.4-1mamba +- automatic version update by autodist + +* Fri Oct 12 2012 Automatic Build System 3.8.3-1mamba +- automatic version update by autodist + +* Fri Aug 10 2012 Automatic Build System 3.8.2-1mamba +- automatic version update by autodist + +* Sat Jun 25 2011 Automatic Build System 3.8.0-1mamba +- automatic update by autodist + +* Fri Aug 13 2010 Silvan Calarco 3.7.9-2mamba +- use macro %_initrddir to install initscript + +* Mon Aug 09 2010 Automatic Build System 3.7.9-1mamba +- automatic update by autodist + +* Fri May 28 2010 Davide Madrisan 3.7.8-1mamba +- update to 3.7.8 +- update package Source and URL + +* Sun Dec 27 2009 Silvan Calarco 3.7.5-4mamba +- rebuilt to remove executable requirements + +* Sun Feb 22 2009 Silvan Calarco 3.7.5-3mamba +- fixed initscript header and added stop command +- use chkconfig command to enable/disable initscript on install/uninstall +- rename source script to logrotate-init + +* Fri Jan 06 2009 Ercole 'ercolinux' Carpanetto 3.7.5-2mamba +- added a reference in rc.local to launch logrotate at boot time + +* Tue Jan 15 2008 Silvan Calarco 3.7.5-1mamba +- update to 3.7.5 +- do not create utmp group +- remove yearly_rotation patch applied upstream +- remove sharedscript patch applied upstream + +* Wed Jun 13 2007 Aleph0 3.7.2-2mamba +- do not compress wtmp rotated files + +* Tue Sep 13 2005 Davide Madrisan 3.7.2-1qilnx +- update to version 3.7.2 by autospec +- enabled selinux +- specfile fixes +- applied patches from fedora package + +* Mon May 26 2003 Silvan Calarco 3.6.8-2qilnx +- creation of needed group utmp + +* Mon May 12 2003 Alessandro Ramazzina 3.6.8-1qilnx +- creation of logrotate package