[OpenIndiana-discuss] svc:/system/update-man-index is slow

Andy Fiddaman andy at omnios.org
Tue Sep 21 13:03:05 UTC 2021



On Tue, 21 Sep 2021, Richard L. Hamilton wrote:

; Most of the time, man indexes don't actually need to be rebuilt. The attached change to /lib/svc/method/update-man-index should (I think) only update the directories (if any) that are not current, so that most of the time, it finishes in a second or so rather than a couple of minutes (less clutter in svcs -xv shortly after system comes up).
;
; If someone wants to review it and if they like it, commit it, that'd be cool.

Hi,

This looks like a really useful change and it will be nice to see the
processes not hanging around after reboot. This script comes up from upstream
illumos-gate so that's where the change would be made in order for OpenIndiana
to pick it up.

You do need a / after the first 'find' argument so that symlinks like
/usr/man are followed and I would probably just check whether there is
any output from find rather than invoking wc and tr. Something like:

    [ -d "$p" -a -f "$p/whatis" ] && \
        [ -z "`find "$p/" -type f -newer "$p/whatis"`" ] && \
        continue  # save time, do not re-index manpath element if current

For illumos-gate, lines need to be < 80 characters too.

Andy




More information about the openindiana-discuss mailing list