run cache update in a transient service using systemd-run

- resolves #1318058
This commit is contained in:
Nikola Forró 2017-11-09 10:44:15 +01:00
parent af41171ebd
commit 8e16b24da6
2 changed files with 29 additions and 3 deletions

View File

@ -0,0 +1,13 @@
[Unit]
DefaultDependencies=no
After=local-fs.target
Before=reboot.target shutdown.target halt.target
JobTimeoutSec=15min
[Service]
Type=oneshot
TimeoutStartSec=infinity
Environment=MAN_NO_LOCALE_WARNING=1
ExecStart=/usr/bin/mandb
Nice=19
IOWeight=20

View File

@ -4,7 +4,7 @@
Summary: Tools for searching and reading man pages
Name: man-db
Version: 2.7.6.1
Release: 5%{?dist}
Release: 6%{?dist}
# GPLv2+ .. man-db
# GPLv3+ .. gnulib
License: GPLv2+ and GPLv3+
@ -14,6 +14,7 @@ URL: http://www.nongnu.org/man-db/
Source0: http://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.xz
Source1: man-db.crondaily
Source2: man-db.sysconfig
Source3: man-db-cache-update.service
Patch0: man-db-2.7.6.1-change-owner-of-man-cache.patch
# http://lists.nongnu.org/archive/html/man-db-devel/2017-01/msg00013.html
@ -26,6 +27,9 @@ Provides: man-pages-reader = %{version}
Provides: bundled(gnulib) = %{gnulib_ver}
Requires: coreutils, grep, groff-base, gzip, less
# for file trigger scriptlets
Requires: systemd
BuildRequires: systemd
BuildRequires: gdbm-devel, gettext, groff, less, libpipeline-devel, zlib-devel
BuildRequires: po4a, perl-interpreter, perl-version
@ -89,6 +93,9 @@ install -D -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/man-db
# config for tmpfiles.d
install -D -p -m 0644 init/systemd/man-db.conf $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/.
# man-db-cache-update.service
install -D -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/man-db-cache-update.service
%find_lang %{name}
%find_lang %{name}-gnulib
@ -107,11 +114,12 @@ fi
# update cache
%transfiletriggerin -- %{_mandir}
MAN_NO_LOCALE_WARNING=1 /usr/bin/mandb -q
/usr/bin/systemd-run /usr/bin/systemctl start man-db-cache-update
# update cache
%transfiletriggerpostun -- %{_mandir}
MAN_NO_LOCALE_WARNING=1 /usr/bin/mandb -q
/usr/bin/systemd-run /usr/bin/systemctl start man-db-cache-update
%files -f %{name}.lang -f %{name}-gnulib.lang
%{!?_licensedir:%global license %%doc}
@ -119,6 +127,7 @@ MAN_NO_LOCALE_WARNING=1 /usr/bin/mandb -q
%doc README man-db-manual.txt man-db-manual.ps ChangeLog NEWS
%config(noreplace) %{_sysconfdir}/man_db.conf
%config(noreplace) /usr/lib/tmpfiles.d/man-db.conf
%{_unitdir}/man-db-cache-update.service
%{_sbindir}/accessdb
%{_bindir}/man
%{_bindir}/whatis
@ -163,6 +172,10 @@ MAN_NO_LOCALE_WARNING=1 /usr/bin/mandb -q
%config(noreplace) %{_sysconfdir}/sysconfig/man-db
%changelog
* Wed Nov 08 2017 Nikola Forró <nforro@redhat.com> - 2.7.6.1-6
- run cache update in a transient service using systemd-run
resolves #1318058
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.6.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild