Compare commits

...

No commits in common. "c8s" and "c9" have entirely different histories.
c8s ... c9

7 changed files with 68 additions and 154 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/acct-6.6.3.tar.gz
SOURCES/acct-6.6.4.tar.gz

View File

@ -1 +1 @@
548bef66398b9394945f32b9e00e91d775c58e07 SOURCES/acct-6.6.3.tar.gz
bf4bb9c138d325add34a8cd836e44a49bc64dfe9 SOURCES/acct-6.6.4.tar.gz

View File

@ -1,105 +0,0 @@
diff -up ./lastcomm.1.ori ./lastcomm.1
--- ./lastcomm.1.ori 2017-02-08 23:28:06.000000000 +0100
+++ ./lastcomm.1 2017-06-22 16:21:46.249345984 +0200
@@ -122,13 +122,10 @@ format as your current machine, but has
.B AHZ.
.TP
.B \-p, \-\-show\-paging
-Print paging statistics
+Print paging statistics.
.TP
.B \-\-pid
-Add pid of the process and pid of the process parent to the output
-(pid is the last but one and parent pid the last column).
-These values are shown only when they are generated by acct function
-(depends on the version of kernel)
+Show PID and PPID of the process if acct version 3 format is supported by kernel.
.TP
.B \-\-debug
Print verbose internal information.
diff -up ./lastcomm.c.ori ./lastcomm.c
--- ./lastcomm.c.ori 2017-04-05 23:06:33.000000000 +0200
+++ ./lastcomm.c 2017-06-22 16:21:14.814430103 +0200
@@ -77,6 +77,8 @@ char *program_name; /* name of the prog
int show_paging = 0; /* If they want paging stats, print 'em */
+char show_pid = 0;
+
static unsigned int hzval;
/* Here are various lists for the user to specify entries that they
@@ -125,6 +127,9 @@ int main(int argc, char *argv[])
{ "show-paging", no_argument, NULL, 11 },
#endif
{ "forwards", no_argument, NULL, 12 },
+#ifdef LINUX_MULTIFORMAT
+ { "pid", no_argument, NULL, 13},
+#endif
{ 0, 0, 0, 0 }
};
@@ -209,6 +214,9 @@ int main(int argc, char *argv[])
}
backwards = 0;
break;
+ case 13:
+ show_pid = 1;
+ break;
case 'h':
case 3:
/* This should fall through to default! */
@@ -304,6 +312,7 @@ void give_usage(void)
#ifdef HAVE_PAGING
"[--show-paging] "
#endif
+ "[--pid] "
"[--ahz <freq>] [--version] [--help]\n", program_name);
print_acct_file_location ();
}
@@ -392,8 +401,8 @@ void parse_entries(void)
(void)putchar(' ');
btime = (time_t) rec->ac_btime;
- if ( show_paging == 0 )
- (void)printf(" %-8.8s %-8.8s %6.2f secs %-16.16s\n",
+ if ( show_paging == 0)
+ (void)printf(" %-8.8s %-8.8s %6.2f secs %-16.16s",
this_uid, this_dev,
#ifdef LINUX_MULTIFORMAT
((ut + st) / (double) rec->ac_ahz),
@@ -403,7 +412,7 @@ void parse_entries(void)
ctime (&btime));
else
#ifdef HAVE_PAGING
- (void)printf(" %6.0fmin %6.0fmaj %4.0fswp %6.2f secs %-16.16s\n",
+ (void)printf(" %6.0fmin %6.0fmaj %4.0fswp %6.2f secs %-16.16s",
minf, majf, swap,
#ifdef LINUX_MULTIFORMAT
((ut + st) / (double) rec->ac_ahz),
@@ -412,8 +421,24 @@ void parse_entries(void)
#endif
ctime (&btime));
#else
- (void)printf(" --- No paging statistics! --- \n" );
+ (void)printf(" --- No paging statistics! --- " );
#endif
+
+
+ if (show_pid)
+ {
+#ifdef LINUX_MULTIFORMAT
+ if ((rec->ac_version & 0x7f) == 3)
+ {
+ (void) printf(" %d %d", rec->ac_pid, rec->ac_ppid);
+ }
+#else
+ (void)printf(" --- No PID information available! --- " );
+#endif
+ }
+
+
+ (void) printf("\n");
}
}
}

View File

@ -0,0 +1,13 @@
diff -up ./lastcomm.1.ori ./lastcomm.1
--- ./lastcomm.1.ori 2018-06-19 17:50:43.223211872 +0200
+++ ./lastcomm.1 2018-06-19 17:50:58.211147752 +0200
@@ -125,9 +125,6 @@ format as your current machine, but has
Print paging statistics.
.TP
.B \-\-pid
-Show PID and PPID of the process if acct version 3 format is supported by kernel.
-.TP
-.B \-\-pid
Add pid of the process and pid of the process parent to the output
(pid is the last but one and parent pid the last column).
These values are shown only when they are generated by acct function

View File

@ -9,7 +9,7 @@
create 0600 root root
postrotate
if %{_bindir}/systemctl --quiet is-active psacct.service ; then
%{_sbindir}/accton /var/account/pacct | %{_bindir}/grep -v "Turning on process accounting, file set to '/var/account/pacct'." | %{_bindir}/cat
%{_bindir}/systemctl reload psacct.service
fi
endscript
}

View File

@ -7,6 +7,7 @@ ConditionPathExists=/var/account
Type=oneshot
ExecStartPre=/usr/libexec/psacct/accton-create
ExecStart=/usr/sbin/accton /var/account/pacct
ExecReload=/usr/sbin/accton /var/account/pacct
ExecStop=/usr/sbin/accton off
RemainAfterExit=yes

View File

@ -3,10 +3,9 @@
Summary: Utilities for monitoring process activities
Name: psacct
Version: 6.6.3
Release: 4%{?dist}
Version: 6.6.4
Release: 12%{?dist}
License: GPLv3+
Group: Applications/System
URL: http://www.gnu.org/software/acct/
Source: ftp://ftp.gnu.org/pub/gnu/acct/acct-%{version}.tar.gz
@ -14,28 +13,17 @@ Source1: psacct.service
Source2: psacct-logrotate.in
Source3: accton-create
#Patch1: psacct-6.3.2-lastcomm_man.patch
#Patch2: acct-6.3.2-sa_manpage.patch
# The upstream man page is more correct than the usage
# .. the C sources need to be fixed, not the man page
#Patch3: psacct-6.3.2-man-pages.patch
Patch4: psacct-6.6.2-unnumberedsubsubsec.patch
#Patch5: psacct-6.6.1-RH-man-page-scan.patch
# Partial replacement for Patch3: psacct-6.3.2-man-pages.patch
#Patch6: psacct-6.6.1-man-dump-acct.patch
# Preventing SEGVs when an incomplete record appears
Patch7: psacct-6.6.1-SEGV-when-record-incomplete.patch
Patch8: psacct-6.6.3-lastcomm-new-pid-option.patch
Patch1: psacct-6.6.2-unnumberedsubsubsec.patch
Patch2: psacct-6.6.1-SEGV-when-record-incomplete.patch
Patch3: psacct-6.6.4-lastcomm-manpage-pid-twice.patch
Conflicts: filesystem < 3
Requires: /sbin/install-info
Requires: coreutils
Requires(post): chkconfig
Requires(post): systemd-sysv
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: make
BuildRequires: autoconf
BuildRequires: systemd
BuildRequires: gcc
@ -54,14 +42,9 @@ commands.
%prep
%setup -q -n acct-%{version}
#%%patch1 -p1 -b .man
#%%patch2 -p1 -b .pct
#%%patch3 -p1 -b .new
%patch4 -p1 -b .subsubsec
#%%patch5 -p1 -b .rh-man-scan
#%%patch6 -p1 -b .man-dump-acct
%patch7 -p1
%patch8 -p1
%patch1 -p1 -b .subsubsec
%patch2 -p1
%patch3 -p1
# fixing 'gets' undeclared
sed -i 's|.*(gets,.*||g' lib/stdio.in.h
@ -110,36 +93,19 @@ rm -f %{buildroot}%{_bindir}/last %{buildroot}%{_mandir}/man1/last.1*
%post
%systemd_post psacct.service
/sbin/install-info %{_infodir}/accounting.info %{_infodir}/dir || :
touch /var/account/pacct && chmod 0600 /var/account/pacct
%preun
%systemd_preun psacct.service
if [ $1 -eq 0 ]; then
# Package removal, not upgrade
/sbin/install-info --delete %{_infodir}/accounting.info %{_infodir}/dir || :
fi
%postun
%systemd_postun_with_restart psacct.service
%triggerun -- psacct < 6.5.5-3
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply psacct
# to migrate them to systemd targets
%{_bindir}/systemd-sysv-convert --save psacct >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del psacct >/dev/null 2>&1 || :
/bin/systemctl try-restart psacct.service >/dev/null 2>&1 || :
%files
%doc README COPYING
%license COPYING
%doc README
%dir /var/account
%{_unitdir}/psacct.service
%attr(0600,root,root) %ghost %config /var/account/pacct
@ -163,10 +129,49 @@ fi
%{_mandir}/man8/accton.8*
%{_mandir}/man8/dump-acct.8*
%{_mandir}/man8/dump-utmp.8*
%{_infodir}/accounting.info.gz
%{_infodir}/accounting.info.*
%changelog
* Thu Oct 28 2021 Jan Rybar <jrybar@redhat.com> - 6.6.4-12
- post-rotate script aligned with systemd usage
- Resolves: rhbz#2015020
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 6.6.4-11
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 6.6.4-10
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Apr 24 2019 Björn Esser <besser82@fedoraproject.org> - 6.6.4-5
- Remove hardcoded gzip suffix from GNU info pages
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Oct 17 2018 Peter Robinson <pbrobinson@fedoraproject.org> 6.6.4-3
- Use %%license, drop legacy sys-v bits
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Jan Rybar <jrybar@redhat.com> - 6.6.4-1
- Rebase to acct-6.6.4
- lastcomm: Fixed "--pid" twice in manpage
* Fri Mar 02 2018 Jan Rybar <jrybar@redhat.com> - 6.6.3-4
- SPEC - changes in Requires and BuildRequires - systemd and gcc