SHA256
1
0
forked from pool/acct

Accepting request 313116 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/313116
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/acct?expand=0&rev=35
This commit is contained in:
2015-06-23 10:00:42 +00:00
committed by Git OBS Bridge
5 changed files with 50 additions and 63 deletions

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon Jun 22 12:40:46 UTC 2015 - tchvatal@suse.com
- Use just /var/log/acct/pacct file and remove the tmpfiles creation
completely
-------------------------------------------------------------------
Mon Jun 22 12:11:02 UTC 2015 - tchvatal@suse.com
- Use try-restart not restart on logrotate update, otherwise we could
suprisingly start the service for user, which is not desired
- Cleanup with spec-cleaner
- Use tmpfiles creation instead of hand-written shell script
------------------------------------------------------------------- -------------------------------------------------------------------
Sun May 17 09:09:27 UTC 2015 - meissner@suse.com Sun May 17 09:09:27 UTC 2015 - meissner@suse.com

View File

@@ -2,12 +2,11 @@
Description=Process accounting Description=Process accounting
Documentation=man:accton(8) Documentation=man:accton(8)
After=syslog.target After=syslog.target
ConditionPathExists=/var/log/account/pacct
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=true RemainAfterExit=true
ExecStartPre=/usr/lib/account/create ExecStartPre=chmod 600 /var/log/account/pacct
ExecStart=/usr/sbin/accton /var/log/account/pacct ExecStart=/usr/sbin/accton /var/log/account/pacct
ExecStop=/usr/sbin/accton off ExecStop=/usr/sbin/accton off

View File

@@ -19,41 +19,26 @@
Name: acct Name: acct
Version: 6.6.2 Version: 6.6.2
Release: 0 Release: 0
Source: http://ftp.gnu.org/gnu/acct/%{name}-%{version}.tar.gz
Source4: http://ftp.gnu.org/gnu/acct/%{name}-%{version}.tar.gz.sig
Source5: %name.keyring
Source1: acct.service
Source2: logrotate.acct
Source3: accton-create
BuildRequires: libtool
%if %suse_version >= 1310
BuildRequires: systemd-rpm-macros
%else
BuildRequires: systemd
%endif
%{?systemd_requires}
%if %suse_version >= 1230
BuildRequires: makeinfo
%endif
Requires: logrotate
Requires(pre): fileutils
Requires(pre): coreutils
Requires(preun): fileutils
Requires(preun): coreutils
Requires(post): %install_info_prereq
Requires(post): fileutils
Requires(post): coreutils
Requires(postun): %install_info_prereq
Requires(postun): fileutils
Requires(postun): coreutils
Patch: %{name}-%{version}-hz.patch
Patch2: %{name}-info.patch
Patch3: %{name}-ac.patch
Url: http://www.gnu.org/software/acct/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: User-Specific Process Accounting Summary: User-Specific Process Accounting
License: GPL-2.0+ License: GPL-2.0+
Group: System/Base Group: System/Base
Url: http://www.gnu.org/software/acct/
Source: http://ftp.gnu.org/gnu/acct/%{name}-%{version}.tar.gz
Source1: acct.service
Source2: logrotate.acct
Source3: http://ftp.gnu.org/gnu/acct/%{name}-%{version}.tar.gz.sig
Source4: %{name}.keyring
Patch0: %{name}-%{version}-hz.patch
Patch2: %{name}-info.patch
Patch3: %{name}-ac.patch
BuildRequires: libtool
BuildRequires: makeinfo
BuildRequires: systemd-rpm-macros
Requires: logrotate
Requires(post): %{install_info_prereq}
Requires(postun): %{install_info_prereq}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
%description %description
This package contains the programs necessary for user-specific process This package contains the programs necessary for user-specific process
@@ -61,14 +46,14 @@ accounting: sa, accton, and lastcomm.
%prep %prep
%setup -q %setup -q
%patch -p1 %patch0 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%build %build
autoreconf -ivf autoreconf -ivf
%configure %configure
make %{?_smp_mflags} CC="%{__cc}" CXX="%{__cxx}" make %{?_smp_mflags}
%install %install
install -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d install -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
@@ -77,23 +62,21 @@ install -d -m 755 %{buildroot}%{_localstatedir}/account/
install -d -m 755 %{buildroot}%{_libexecdir}/account install -d -m 755 %{buildroot}%{_libexecdir}/account
install -d -m 755 %{buildroot}%{_sbindir} install -d -m 755 %{buildroot}%{_sbindir}
install -d -m 755 %{buildroot}%{_bindir} install -d -m 755 %{buildroot}%{_bindir}
%make_install CC="%{__cc}" CXX="%{__cxx}" %make_install
install -m 644 %{S:1} %{buildroot}/%{_unitdir}/acct.service
install -m 644 %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/acct install -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}/acct.service
> %{buildroot}%{_localstatedir}/account/pacct ln -sf service %{buildroot}%{_sbindir}/rcacct
chmod 600 %{buildroot}%{_localstatedir}/account/pacct
cd %{buildroot}/usr/sbin/ install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/acct
ln -sf service rcacct mkdir -p %{buildroot}%{_localstatedir}/log/account
rm -f %{buildroot}/usr/bin/last
rm -f %{buildroot}%{_bindir}/last
rm -f %{buildroot}/%{_mandir}/man1/last.1* rm -f %{buildroot}/%{_mandir}/man1/last.1*
install -m 0755 %{S:3} %{buildroot}%{_libexecdir}/account/create
%pre %pre
%service_add_pre acct.service %service_add_pre acct.service
%post %post
echo "Creating %{_localstatedir}/account/pacct"
%{_libexecdir}/account/create
%install_info --info-dir=%{_infodir} %{_infodir}/accounting.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/accounting.info.gz
%service_add_post acct.service %service_add_post acct.service
@@ -107,18 +90,16 @@ echo "Creating %{_localstatedir}/account/pacct"
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%doc README NEWS %doc README NEWS
%doc %{_infodir}/*.info.* %{_infodir}/*.info.*
%doc %{_mandir}/man1/ac* %{_mandir}/man1/ac*
%doc %{_mandir}/man1/lastcomm* %{_mandir}/man1/lastcomm*
%doc %{_mandir}/man8/* %{_mandir}/man8/*
%dir %{_localstatedir}/account
%attr(600, root, root) %ghost %{_localstatedir}/account/pacct
%config %{_sysconfdir}/logrotate.d/acct %config %{_sysconfdir}/logrotate.d/acct
%dir %{_localstatedir}/log/account
%ghost %{_localstatedir}/log/account/pacct
%{_bindir}/ac %{_bindir}/ac
%{_bindir}/lastcomm %{_bindir}/lastcomm
%{_sbindir}/* %{_sbindir}/*
%{_unitdir}/acct.service %{_unitdir}/acct.service
%dir %{_libexecdir}/account
%{_libexecdir}/account/create
%changelog %changelog

View File

@@ -1,7 +0,0 @@
#!/bin/bash
ACCTFILE=/var/account/pacct
if test ! -e $ACCTFILE
then
umask 066
> $ACCTFILE
fi

View File

@@ -8,7 +8,7 @@
missingok missingok
create 640 root root create 640 root root
postrotate postrotate
/usr/bin/systemctl restart acct.service /usr/bin/systemctl try-restart acct.service
endscript endscript
} }