diff --git a/.cvsignore b/.cvsignore index d05fc4b..0124769 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -sysstat-4.0.7.tar.bz2 +sysstat-5.0.0.tar.bz2 diff --git a/sources b/sources index 5b1770c..f7792f7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4756d98b7fd8a0999129e88643ea5869 sysstat-4.0.7.tar.bz2 +64a6f2956b6178961e0fa1aa1fd7d9a4 sysstat-5.0.0.tar.bz2 diff --git a/sysstat.crond b/sysstat.crond index 04a1771..ebb6260 100644 --- a/sysstat.crond +++ b/sysstat.crond @@ -1,5 +1,5 @@ # run system activity accounting tool every 10 minutes -*/10 * * * * root /usr/lib64/sa/sa1 1 1 +*/10 * * * * root /usr/lib/sa/sa1 1 1 # generate a daily summary of process accounting at 23:53 -53 23 * * * root /usr/lib64/sa/sa2 -A +53 23 * * * root /usr/lib/sa/sa2 -A diff --git a/sysstat.spec b/sysstat.spec index 90a6b53..b4491a7 100644 --- a/sysstat.spec +++ b/sysstat.spec @@ -1,6 +1,6 @@ Name: sysstat -Version: 4.0.7 -Release: 5 +Version: 5.0.0 +Release: 0.6 Summary: The sar and iostat system monitoring commands. License: GPL Group: Applications/System @@ -8,15 +8,21 @@ URL: http://perso.wanadoo.fr/sebastien.godard/ Source: http://perso.wanadoo.fr/sebastien.godard/%{name}-%{version}.tar.bz2 Source1: sysstat.crond Source2: sysstat.crondaily +Source3: sysstat.sysconfig Patch0: sysstat-4.0.1-config.patch Patch1: sysstat-4.0.1-prevday.patch Patch2: sysstat-3.3.5-fixutilization.patch -Patch3: sysstat-4.0.1-verbose.patch +Patch3: sysstat-5.0.0-verbose.patch Patch4: sysstat-4.0.7-lib64.patch +Patch5: sysstat-5.0.0-ifnamsiz.patch +Patch6: sysstat-5.0.0-history.patch +Patch7: sysstat-5.0.0-statreset.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root -Requires: kernel >= 2.2.16-21 +Requires: kernel >= 2.2.16-21 /sbin/chkconfig Prereq: sh-utils textutils grep fileutils /etc/cron.d +BuildRequires: perl %{_includedir}/linux/if.h +Requires: %__cp %__mv %__chmod %__grep %__mkdir %__install %__id %description This package provides the sar and iostat commands for Linux. Sar and @@ -30,6 +36,9 @@ activity. #patch2 -p1 -b .fixutilization %patch3 -p1 -b .verbose %patch4 -p1 -b .lib64 +%patch5 -p1 -b .ifnamsiz +%patch6 -p1 -b .history +%patch7 -p1 -b .statreset %build # FIXME: I need to fix the upstream Makefile to use LIBDIR et al. properly and @@ -37,20 +46,28 @@ activity. CFLAGS="$RPM_OPT_FLAGS -DSADC_PATH=\\\"%{_libdir}/sa/sadc\\\"" make CFLAGS="$CFLAGS" PREFIX=%{_prefix} LIB_DIR=%{_libdir} MAN_DIR=%{_mandir} DATA_DIR=%{_datadir} DOC_DIR=%{_docdir} +# Thou shalt not write to source files or patches +rm -f sysstat.crond +%if %_lib == "lib64" +perl -p -e "s|/lib|/lib64|g" %{SOURCE1} > sysstat.crond +%else +cat %{SOURCE1} > sysstat.crond +%endif + %install rm -rf %{buildroot} -%makeinstall PREFIX=%{_prefix} LIB_DIR=%{_libdir} MAN_DIR=%{_mandir} DATA_DIR=%{_datadir} DOC_DIR=%{_docdir} +%makeinstall PREFIX=%{_prefix} LIB_DIR=%{_libdir} MAN_DIR=%{_mandir} DATA_DIR=%{_datadir} DOC_DIR=%{_docdir} INIT_DIR=%{_initrddir} #make install MAN_DIR=%{_mandir} -mkdir -p %{buildroot}/etc/{cron.daily,cron.d} +mkdir -p %{buildroot}/etc/{cron.daily,cron.d,sysconfig} -%ifarch x86_64 ppc64 s390x -perl -pi -e "s|/lib|/lib64|g" %{SOURCE1} -%endif - -install %{SOURCE1} %{buildroot}/etc/cron.d/sysstat +install -m 0644 sysstat.crond %{buildroot}/etc/cron.d/sysstat #install %{SOURCE2} %{buildroot}/etc/cron.daily/sysstat +install -m 0644 %{SOURCE3} %{buildroot}/etc/sysconfig/sysstat + +mkdir -p %{buildroot}%{_initrddir} +install -m 0755 sysstat %{buildroot}%{_initrddir}/ # sysstat makefiles install the docs in the wrong place, blow them away rm -f %{buildroot}/usr/share/doc/* @@ -61,14 +78,26 @@ rm -f %{buildroot}/usr/share/doc/* %triggerpostun -- sysstat <= 3.3.3-1 # earlier versions of sysstat had crontabs done in a bad way. fix it. if [ `id -u` = "0" -a "$1" -ge "2" ]; then - egrep -v 'sysstat|sa1|sa2' /etc/crontab > /tmp/crontab.$$ - mv /tmp/crontab.$$ /etc/crontab && chmod 644 /etc/crontab + if grep -E -v 'sysstat|sa1|sa2' /etc/crontab > /etc/crontab.tmp.$$; then + cp -dpf /etc/crontab /etc/crontab.save.$$ && \ + if mv /etc/crontab.tmp.$$ /etc/crontab; then + chmod --reference=/etc/crontab.save.$$ /etc/crontab && \ + rm -f /etc/crontab.save.$$ + else + mv -f /etc/crontab.save.$$ /etc/crontab + fi + fi fi +%post +/sbin/chkconfig --add sysstat + %preun if [ "$1" = 0 ]; then # Remove sa logs if removing sysstat completely rm -f /var/log/sa/* + # Remove service + /sbin/chkconfig --del sysstat fi %clean @@ -79,6 +108,8 @@ rm -rf %{buildroot} %doc CHANGES COPYING CREDITS README TODO %config(noreplace) /etc/cron.d/sysstat #config(noreplace) /etc/cron.daily/sysstat +%config(noreplace) /etc/sysconfig/sysstat +%{_initrddir}/sysstat %{_bindir}/* %{_libdir}/sa %{_mandir}/man1/* @@ -86,6 +117,29 @@ rm -rf %{buildroot} /var/log/sa %changelog +* Thu Jan 22 2004 Nils Philippsen 5.0.0-0.6 +- let user configure how long to keep logs through /etc/sysconfig/sysstat + (#81294) +- reset stats at system boot (#102445) + +* Wed Jan 21 2004 Nils Philippsen 5.0.0-0.5 +- fix ifnamsiz patch for s390x (hopefully) + +* Tue Jan 20 2004 Nils Philippsen 5.0.0-0.4 +- fix insecure tmp files in scripts (#78212) +- require tools needed in scripts +- use IFNAMSIZ from %{_includedir}/linux/if.h for maximum interface length + +* Mon Jan 12 2004 Nils Philippsen 5.0.0-0.3 +- Buildrequires: perl +- check for %%_lib == lib64 instead of specific arches + +* Mon Jan 12 2004 Nils Philippsen 5.0.0-0.2 +- fix dealing with lib64 case of cron.d file + +* Mon Jan 12 2004 Nils Philippsen 5.0.0-0.1 +- version 5.0.0 + * Wed Jun 04 2003 Elliot Lee - rebuilt diff --git a/sysstat.sysconfig b/sysstat.sysconfig new file mode 100644 index 0000000..5aeb175 --- /dev/null +++ b/sysstat.sysconfig @@ -0,0 +1,2 @@ +# How long to keep log files (days), maximum is a month +HISTORY=7