2004-09-09 10:48:58 +00:00
|
|
|
# Our /usr/bin/last is in the SysVInit packae
|
|
|
|
%define with_last 0
|
2004-09-09 10:48:03 +00:00
|
|
|
|
2004-09-09 10:47:19 +00:00
|
|
|
%define FHS_compliant 1
|
|
|
|
|
|
|
|
%if %{FHS_compliant}
|
|
|
|
%define accounting_logdir /var/account
|
|
|
|
%else
|
|
|
|
%define accounting_logdir /var/log
|
|
|
|
%endif
|
|
|
|
|
2004-09-09 10:46:23 +00:00
|
|
|
Summary: Utilities for monitoring process activities.
|
|
|
|
Name: psacct
|
|
|
|
Version: 6.3.2
|
2005-02-15 13:09:59 +00:00
|
|
|
Release: 36
|
2004-09-09 10:46:23 +00:00
|
|
|
License: GPL
|
|
|
|
Group: Applications/System
|
|
|
|
Source: ftp://ftp.gnu.org/pub/gnu/acct-6.3.2.tar.gz
|
2004-09-09 10:47:19 +00:00
|
|
|
Source1: psacct.init
|
|
|
|
# This dumb patch breaks FHS 2.2 compliance, so it is disabled now except
|
|
|
|
# in 7.x builds. Do not use it in new products.
|
2004-09-09 10:46:23 +00:00
|
|
|
Patch0: acct-6.3.2-config.patch
|
|
|
|
Patch1: acct-6.3.2-exit.patch
|
2004-09-09 10:47:19 +00:00
|
|
|
# Fixes some broken calls to ctime() on 64bit arch's <mharris@redhat.com>
|
|
|
|
Patch2: psacct-6.3.2-64bit-fixes.patch
|
2005-02-07 17:21:14 +00:00
|
|
|
Patch3: psacct-6.3.2-hzval-fixes2.patch
|
2004-09-09 10:50:13 +00:00
|
|
|
Patch4: acct-6.3.2-pts.patch
|
2005-02-07 17:21:14 +00:00
|
|
|
Patch5: psacct-6.3.2-strictmatch.patch
|
2005-02-15 13:09:59 +00:00
|
|
|
Patch6: psacct-6.3.2-sa-manfix.patch
|
2004-09-09 10:47:19 +00:00
|
|
|
|
2004-09-09 10:46:23 +00:00
|
|
|
Buildroot: %{_tmppath}/%{name}-%{version}-root
|
|
|
|
Prereq: /sbin/install-info
|
|
|
|
BuildRequires: autoconf
|
|
|
|
|
2004-09-09 10:47:19 +00:00
|
|
|
# This conflict is to avoid psacct being forced on by old initscripts now that
|
|
|
|
# we have a proper initscript in place. initscripts 6.55 and later are fixed.
|
|
|
|
Conflicts: initscripts < 6.55
|
|
|
|
|
2004-09-09 10:46:23 +00:00
|
|
|
%description
|
|
|
|
The psacct package contains several utilities for monitoring process
|
|
|
|
activities, including ac, lastcomm, accton and sa. The ac command
|
|
|
|
displays statistics about how long users have been logged on. The
|
|
|
|
lastcomm command displays information about previous executed
|
|
|
|
commands. The accton command turns process accounting on or off. The
|
|
|
|
sa command summarizes information about previously executed
|
|
|
|
commmands.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n acct-%{version}
|
2004-09-09 10:47:19 +00:00
|
|
|
|
|
|
|
%if ! %{FHS_compliant}
|
2004-09-09 10:46:23 +00:00
|
|
|
%patch0 -p0 -b .config
|
2004-09-09 10:47:19 +00:00
|
|
|
%endif
|
|
|
|
%patch1 -p1 -b .psacct-exit
|
|
|
|
%patch2 -p0 -b .64bit-fixes
|
2004-09-09 10:50:13 +00:00
|
|
|
%patch3 -p1 -b .hz
|
|
|
|
%patch4 -p1 -b .pts
|
2005-02-07 17:21:14 +00:00
|
|
|
%patch5 -p1 -b .strictmatch
|
2005-02-15 13:09:59 +00:00
|
|
|
%patch6 -p1 -b .tio-avio
|
2004-09-09 10:46:23 +00:00
|
|
|
|
|
|
|
%build
|
2004-09-09 10:47:19 +00:00
|
|
|
%if ! %{FHS_compliant}
|
2004-09-09 10:46:23 +00:00
|
|
|
autoconf
|
2004-09-09 10:47:19 +00:00
|
|
|
%endif
|
|
|
|
|
2004-09-09 10:46:23 +00:00
|
|
|
%configure
|
|
|
|
sed -e "s/\/\* #undef HAVE_LINUX_ACCT_H \*\//#define HAVE_LINUX_ACCT_H/" config.h > config.h.new
|
2005-02-07 17:21:14 +00:00
|
|
|
sed -e "s;#define HAVE_ACIO 1;/* #undef HAVE_ACIO */;" config.h.new > config.h
|
2004-09-09 10:46:23 +00:00
|
|
|
touch texinfo.tex
|
|
|
|
make
|
|
|
|
|
|
|
|
%install
|
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
2004-09-09 10:47:19 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT{/sbin,%{_bindir},%{_mandir},%{_sbindir}}
|
2004-09-09 10:46:23 +00:00
|
|
|
%{makeinstall}
|
|
|
|
|
|
|
|
# move accton to /sbin -- leave historical symlink
|
|
|
|
mv $RPM_BUILD_ROOT%{_sbindir}/accton $RPM_BUILD_ROOT/sbin/accton
|
|
|
|
ln -s ../../sbin/accton $RPM_BUILD_ROOT%{_sbindir}/accton
|
|
|
|
|
|
|
|
gzip -9f $RPM_BUILD_ROOT%{_infodir}/*
|
2004-09-09 10:47:19 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{accounting_logdir}
|
|
|
|
touch $RPM_BUILD_ROOT%{accounting_logdir}/pacct
|
2004-09-09 10:46:23 +00:00
|
|
|
|
2004-09-09 10:47:19 +00:00
|
|
|
# Create logrotate config file
|
2004-09-09 10:46:23 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
|
|
|
|
cat > $RPM_BUILD_ROOT/etc/logrotate.d/psacct <<EOF
|
|
|
|
# Logrotate file for psacct RPM
|
|
|
|
|
2004-09-09 10:47:19 +00:00
|
|
|
%{accounting_logdir}/pacct {
|
2005-02-15 09:48:54 +00:00
|
|
|
#prerotate loses accounting records, let's no
|
|
|
|
# prerotate
|
|
|
|
# %{_sbindir}/accton
|
|
|
|
# endscript
|
|
|
|
compress
|
|
|
|
delaycompress
|
|
|
|
notifempty
|
|
|
|
daily
|
|
|
|
rotate 31
|
|
|
|
create 0600 root root
|
|
|
|
postrotate
|
|
|
|
%{_sbindir}/accton %{accounting_logdir}/pacct
|
|
|
|
endscript
|
2004-09-09 10:46:23 +00:00
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2004-09-09 10:47:19 +00:00
|
|
|
# Install initscript
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
|
|
|
|
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/psacct
|
|
|
|
|
2004-09-09 10:48:58 +00:00
|
|
|
%if ! %{with_last}
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_bindir}/last $RPM_BUILD_ROOT%{_mandir}/man1/last.1*
|
|
|
|
%endif
|
2004-09-09 10:46:23 +00:00
|
|
|
|
|
|
|
%clean
|
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%post
|
2004-09-09 10:48:03 +00:00
|
|
|
/sbin/chkconfig --add psacct
|
2004-09-09 10:46:23 +00:00
|
|
|
# we need this hack to get rid of an old, incorrect accounting info entry.
|
|
|
|
if [ $1 = 0 ]; then
|
2004-09-09 10:48:58 +00:00
|
|
|
test -f /etc/info-dir && {
|
|
|
|
grep -v '* accounting: (psacct)' < /etc/info-dir > /etc/info-dir.new
|
|
|
|
mv -f /etc/info-dir.new /etc/info-dir
|
|
|
|
}
|
2004-09-09 10:46:23 +00:00
|
|
|
/sbin/install-info %{_infodir}/accounting.info.gz %{_infodir}/dir --entry="* accounting: (accounting). The GNU Process Accounting Suite."
|
|
|
|
fi
|
|
|
|
|
|
|
|
%preun
|
|
|
|
if [ $1 = 0 ]; then
|
2004-09-09 10:47:19 +00:00
|
|
|
/sbin/install-info --delete %{_infodir}/accounting.info.gz %{_infodir}/dir --entry="* accounting: (accounting). The GNU Process Accounting Suite." 2>/dev/null
|
2005-02-07 17:21:14 +00:00
|
|
|
/sbin/service psacct stop > /dev/null 2>&1
|
2004-09-09 10:47:19 +00:00
|
|
|
/sbin/chkconfig --del psacct
|
2004-09-09 10:46:23 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2004-09-09 10:47:19 +00:00
|
|
|
%if %{FHS_compliant}
|
|
|
|
%dir /var/account
|
|
|
|
%endif
|
|
|
|
/etc/rc.d/init.d/psacct
|
|
|
|
%attr(0600,root,root) %config %{accounting_logdir}/pacct
|
2004-09-09 10:46:23 +00:00
|
|
|
%attr(0644,root,root) %config(noreplace) /etc/logrotate.d/*
|
|
|
|
/sbin/accton
|
|
|
|
%{_sbindir}/accton
|
|
|
|
%{_sbindir}/sa
|
|
|
|
%{_sbindir}/dump-utmp
|
|
|
|
%{_sbindir}/dump-acct
|
|
|
|
%{_bindir}/ac
|
2004-09-09 10:48:58 +00:00
|
|
|
%if %{with_last}
|
|
|
|
%{_bindir}/last
|
|
|
|
%endif
|
2004-09-09 10:46:23 +00:00
|
|
|
%{_bindir}/lastcomm
|
|
|
|
%{_mandir}/man1/ac.1*
|
2004-09-09 10:48:58 +00:00
|
|
|
%if %{with_last}
|
|
|
|
%{_mandir}/man1/last.1*
|
|
|
|
%endif
|
2004-09-09 10:46:23 +00:00
|
|
|
%{_mandir}/man1/lastcomm.1*
|
|
|
|
%{_mandir}/man8/sa.8*
|
|
|
|
%{_mandir}/man8/accton.8*
|
|
|
|
%{_infodir}/accounting.info.gz
|
|
|
|
|
|
|
|
%changelog
|
2005-02-15 13:09:59 +00:00
|
|
|
* Tue Feb 15 2005 Ivana Varekova <varekova@redhat.com> 6.3.2-36
|
|
|
|
- fix sa manpage - necessary becouse of bug #43294 and previous patch
|
|
|
|
|
2005-02-15 09:48:54 +00:00
|
|
|
* Tue Feb 15 2005 Ivana Varekova <varekova@redhat.com> 6.3.2-35
|
|
|
|
- fix #147782 logrotate script error
|
|
|
|
|
2005-02-07 17:21:14 +00:00
|
|
|
* Thu Feb 3 2005 Charles Bennett <ccb@redhat.com> 6.3.2-33.fc4
|
|
|
|
- rhbz 133077: logrotate fixed to continue accounting during rotate
|
|
|
|
- rhbz 141802: lastcomm was not handling all forms of --strict-match
|
|
|
|
- rhbz 141971: rpm -e no longer leaves /var/lock/subsys/psacct
|
|
|
|
- rhbz 43294: sa will never report any io because the kernel doesn't
|
|
|
|
provide it. Tweaked to ignore ac_io in acct.h
|
|
|
|
- integrate lastcomm hz patch from RH support
|
|
|
|
|
2004-09-09 10:50:13 +00:00
|
|
|
* Wed Sep 1 2004 root <ccb@redhat.com> - 6.3.2-31
|
|
|
|
- integrate JFenlason's hz patch, improve pts device reporting
|
2004-09-09 10:50:06 +00:00
|
|
|
|
2004-09-09 10:50:01 +00:00
|
|
|
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
|
|
|
|
- rebuilt
|
|
|
|
|
2004-09-09 10:49:31 +00:00
|
|
|
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
|
|
|
|
- rebuilt
|
|
|
|
|
2004-09-09 10:48:58 +00:00
|
|
|
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
|
|
|
|
- rebuilt
|
|
|
|
|
|
|
|
* Thu Dec 26 2002 Florian La Roche <Florian.LaRoche@redhat.de>
|
|
|
|
- make /etc/info-dir an optional file
|
|
|
|
|
|
|
|
* Wed Nov 13 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-25
|
|
|
|
- Added with_last conditional to disable /usr/bin/last because ours is in
|
|
|
|
the SysVInit package. This fixes unpackaged files terminate build prob.
|
|
|
|
|
2004-09-09 10:48:16 +00:00
|
|
|
* Thu Aug 22 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-24
|
|
|
|
- Fixed initscript reload/restart by creating start/stop functions and
|
|
|
|
making everything use them (#72261)
|
|
|
|
|
2004-09-09 10:48:03 +00:00
|
|
|
* Tue Aug 6 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-23
|
|
|
|
- Fixed chkconfig issue in rpm scripts (#61191)
|
|
|
|
- Excludearch ia64, not taking the time to debug/troubleshoot random
|
|
|
|
buildsystem failure due to higher priorities.
|
|
|
|
|
2004-09-09 10:47:49 +00:00
|
|
|
* Mon Jul 08 2002 Elliot Lee <sopwith@redhat.com>
|
|
|
|
- Take the time to make sure things get through on all archs, by simply
|
2004-09-09 10:48:03 +00:00
|
|
|
running it through the build system.
|
2004-09-09 10:47:49 +00:00
|
|
|
|
|
|
|
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
|
|
|
|
- automated rebuild
|
|
|
|
|
|
|
|
* Thu May 23 2002 Tim Powers <timp@redhat.com>
|
|
|
|
- automated rebuild
|
|
|
|
|
2004-09-09 10:47:24 +00:00
|
|
|
* Tue Mar 27 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-19
|
|
|
|
- Made initscript touch/chmod accounting file if it is not present during
|
|
|
|
startup, to ensure accounting works properly when enabled.
|
|
|
|
|
2004-09-09 10:47:19 +00:00
|
|
|
* Mon Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18
|
|
|
|
- Fixed duh in initscript pointing to wrong accounting file (#61939)
|
|
|
|
|
|
|
|
* Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17
|
|
|
|
- Removed the files usracct and savacct, which are not used by psacct
|
|
|
|
utilities at all, but by the sa program. Our sa uses files in a different
|
|
|
|
location, and so these files are unused and unnecessary.
|
|
|
|
|
|
|
|
* Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16
|
|
|
|
- Added chkconfig to post and preun scripts for bug (#61191)
|
|
|
|
|
|
|
|
* Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15
|
|
|
|
- Added new feature - psacct initscript now controls process accounting so
|
|
|
|
that it is not just forced on if installed as was the previous behaviour
|
|
|
|
- Modified the initscripts package to not force psacct on anymore and made
|
|
|
|
the new psacct-6.3.2-15 conflict with previous initscripts packages.
|
|
|
|
- Fixed logrotate config to set perms/owner of new log files, and closed
|
|
|
|
bug (#54165)
|
|
|
|
|
|
|
|
* Thu Mar 7 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14
|
|
|
|
- Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712)
|
|
|
|
|
|
|
|
* Wed Mar 6 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13
|
|
|
|
- Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new
|
|
|
|
flag, and fixed bug (#60716)
|
|
|
|
|
|
|
|
* Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12
|
|
|
|
- rebuild in new environment for FHS correctness
|
|
|
|
|
|
|
|
* Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11
|
|
|
|
- Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x
|
|
|
|
builds, as it breaks FHS compliance by putting files in nonstandard
|
|
|
|
locations. Also fixed up other places in specfile for FHS 2.2.
|
|
|
|
- Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk
|
|
|
|
really really badly.
|
|
|
|
|
|
|
|
- Bumped to -11 to avoid buildsystem stupidness
|
|
|
|
|
2004-09-09 10:46:28 +00:00
|
|
|
* Thu Sep 06 2001 Mike A. Harris <mharris@redhat.com> 6.3.2-9
|
|
|
|
- Fixed bug (#53307) psacct is enabled by default, and the log files
|
|
|
|
are huge, and will fill the disk up very quickly. logrotate will
|
|
|
|
now compress them daily.
|
|
|
|
|
|
|
|
* Sat Sep 01 2001 Florian La Roche <Florian.LaRoche@redhat.de> 6.3.2-8
|
2004-09-09 10:46:23 +00:00
|
|
|
- do not fail for ENOSYS to silently support kernels without
|
|
|
|
process accounting
|
|
|
|
|
|
|
|
* Sun Aug 26 2001 Mike A. Harris <mharris@redhat.com> 6.3.2-7
|
|
|
|
- Change spec tag Copyright -> License
|
|
|
|
- change logrotate to rotate daily, and keep 1 month (31 days) of data
|
|
|
|
|
|
|
|
* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
|
|
|
|
- Bump release + rebuild.
|
|
|
|
|
|
|
|
* Mon Feb 02 2001 Helge Deller <hdeller@redhat.de>
|
|
|
|
- added logrotate file for /var/log/pacct (#24900)
|
|
|
|
|
|
|
|
* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
|
|
|
|
- automatic rebuild
|
|
|
|
|
|
|
|
* Mon Jun 5 2000 Nalin Dahyabhai <nalin@redhat.com>
|
|
|
|
- FHS fixes
|
|
|
|
|
|
|
|
* Sat May 6 2000 Bill Nottingham <notting@redhat.com>
|
|
|
|
- fix for new patch
|
|
|
|
|
|
|
|
* Thu Feb 03 2000 Nalin Dahyabhai <nalin@redhat.com>
|
|
|
|
- update to 6.3.2
|
|
|
|
|
|
|
|
* Mon Apr 05 1999 Preston Brown <pbrown@redhat.com>
|
|
|
|
- wrap post script with reference count.
|
|
|
|
|
|
|
|
* Tue Mar 23 1999 Preston Brown <pbrown@redhat.com>
|
|
|
|
- install-info sucks. Still.
|
|
|
|
|
|
|
|
* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
|
|
|
|
- auto rebuild in the new build environment (release 8)
|
|
|
|
|
|
|
|
* Thu Mar 18 1999 Bill Nottingham <notting@redhat.com>
|
|
|
|
- #define HAVE_LINUX_ACCT_H too, so it works. :)
|
|
|
|
|
|
|
|
* Sun Aug 16 1998 Jeff Johnson <jbj@redhat.com>
|
|
|
|
- accton needs to be accessible to /etc/rc.d/init.d/halt
|
|
|
|
|
|
|
|
* Fri May 08 1998 Erik Troan <ewt@redhat.com>
|
|
|
|
- install-info sucks
|
|
|
|
|
|
|
|
* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
|
|
|
|
- translations modified for de, fr, tr
|
|
|
|
|
|
|
|
* Thu Oct 23 1997 Donnie Barnes <djb@redhat.com>
|
|
|
|
- updated from 6.2 to 6.3
|
|
|
|
|
|
|
|
* Mon Jul 21 1997 Erik Troan <ewt@redhat.com>
|
|
|
|
- built against glibc
|