- Logfile creation in the systemd unit file (#918132)

This commit is contained in:
Jaromir Capik 2013-04-11 20:56:49 +02:00
parent 73565819d0
commit 33de87e741
3 changed files with 17 additions and 4 deletions

3
accton-create Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
ACCTFILE=/var/account/pacct
[ ! -r $ACCTFILE ] && touch $ACCTFILE && chmod 600 $ACCTFILE

View File

@ -1,12 +1,13 @@
[Unit]
Description=Kernel process accounting
After=syslog.target
ConditionPathExists=/var/account/pacct
ConditionPathExists=/var/account
[Service]
Type=oneshot
ExecStart=/sbin/accton /var/account/pacct
ExecStop=/sbin/accton off
ExecStartPre=/usr/libexec/psacct/accton-create
ExecStart=/usr/sbin/accton /var/account/pacct
ExecStop=/usr/sbin/accton off
RemainAfterExit=yes
[Install]

View File

@ -4,13 +4,14 @@
Summary: Utilities for monitoring process activities
Name: psacct
Version: 6.6.1
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv3+
Group: Applications/System
URL: ftp://ftp.gnu.org/pub/gnu/acct/
Source: ftp://ftp.gnu.org/pub/gnu/acct/acct-%{version}.tar.gz
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
Patch3: psacct-6.3.2-man-pages.patch
@ -76,6 +77,10 @@ sed -e 's|%%{_bindir}|%{_bindir}|g' -e 's|%%{_sbindir}|%{_sbindir}|g' %{SOURCE2}
mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
# install accton-create script
install -d -m 0755 %{buildroot}%{_libexecdir}/psacct
install -m 755 %{SOURCE3} %{buildroot}%{_libexecdir}/psacct/
%if ! %{with_last}
rm -f %{buildroot}%{_bindir}/last %{buildroot}%{_mandir}/man1/last.1*
%endif
@ -117,6 +122,7 @@ fi
%{_sbindir}/sa
%{_sbindir}/dump-utmp
%{_sbindir}/dump-acct
%{_libexecdir}/psacct/accton-create
%{_bindir}/ac
%if %{with_last}
%{_bindir}/last
@ -134,6 +140,9 @@ fi
%{_infodir}/accounting.info.gz
%changelog
* Thu Apr 11 2013 Jaromir Capik <jcapik@redhat.com> - 6.6.1-2
- Logfile creation in the systemd unit file (#918132)
* Tue Apr 09 2013 Jaromir Capik <jcapik@redhat.com> - 6.6.1-1
- Update to 6.6.1
- Fixing bogus dates in the changelog