#5 Avoid noisy output from man-db-cache-update triggers
Merged 6 years ago by nforro. Opened 6 years ago by tmz.
rpms/ tmz/man-db master  into  master

file modified
+6 -3
@@ -4,7 +4,7 @@ 

  Summary: Tools for searching and reading man pages

  Name: man-db

  Version: 2.7.6.1

- Release: 12%{?dist}

+ Release: 13%{?dist}

  # GPLv2+ .. man-db

  # GPLv3+ .. gnulib

  License: GPLv2+ and GPLv3+
@@ -116,13 +116,13 @@ 

  # update cache

  %transfiletriggerin -- %{_mandir}

  if [ -x /usr/bin/systemd-run -a -x /usr/bin/systemctl ]; then

-     /usr/bin/systemd-run /usr/bin/systemctl start man-db-cache-update || :

+     /usr/bin/systemd-run /usr/bin/systemctl start man-db-cache-update >/dev/null 2>&1 || :

  fi

  

  # update cache

  %transfiletriggerpostun -- %{_mandir}

  if [ -x /usr/bin/systemd-run -a -x /usr/bin/systemctl ]; then

-     /usr/bin/systemd-run /usr/bin/systemctl start man-db-cache-update || :

+     /usr/bin/systemd-run /usr/bin/systemctl start man-db-cache-update >/dev/null 2>&1 || :

  fi

  

  
@@ -177,6 +177,9 @@ 

  %config(noreplace) %{_sysconfdir}/cron.daily/man-db.cron

  

  %changelog

+ * Sat Feb 03 2018 Todd Zullinger <tmz@pobox.com> - 2.7.6.1-13

+ - Avoid noisy output from man-db-cache-update triggers

+ 

  * Tue Jan 16 2018 Jiri Kucera <jkucera@redhat.com> - 2.7.6.1-12

  - fix segmentation fault caused by 'man -D?'

    resolves: #1495507

When the man-db-cache-update trigger added in 8e16b24 ("run cache update
in a transient service using systemd-run - resolves #1318058",
2017-11-09) is run, it produces potentially confusing output:

Running transaction
Preparing : 1/1
Upgrading : fedpkg-1.31-1.fc26.noarch 1/2
Cleanup : fedpkg-1.30-4.fc26.noarch 2/2
Running scriptlet: fedpkg-1.30-4.fc26.noarch 2/2
Running as unit: run-re2635381e8fe44a6aad4926eddab6961.service
Running as unit: run-r8f76223bb81544e8b6f53b8c88b3e72f.service
Verifying : fedpkg-1.31-1.fc26.noarch 1/2
Verifying : fedpkg-1.30-4.fc26.noarch 2/2

The 'Running as unit: run-*.service' output is of little use to users.
The start of the service is logged to syslog/journal already. Send
stdout of the trigger scriptlet to /dev/null.

I agree with the suggested change. Scriptlets in general should not produce any output.

Arguably, stderr should go to /dev/null too, but I erred on the side of caution. If that seems reasonable I can update the commit to handle stderr as well.

I'd say squelch all output, so yeah, stderr too.

rebased onto fe82cc6

6 years ago

Pull-Request has been merged by nforro

6 years ago