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

Richard L. Hamilton rlhamil at smart.net
Tue Sep 21 14:10:18 UTC 2021


The / after $p is sensible (although /usr/man and /usr/share/man are both in the path I saw, which is harmless but redundant). The formatting...ok, everybody has their conventions. Granted that wc and tr are less efficient that what you suggest, in rare cases (like if lots of man pages were recently updated) there could be a LOT of output from the find, to the point that I'd hesitate to test the shell's limits for how much can go in a shell variable. Realistically that's not a problem, since the total characters in find /usr/share/man/ (the biggest, probably) is under a megabyte, and ksh on opensolaris can handle it easily. So you're right on efficiency, but I think in a really extreme (order(s) of magnitude higher than typical) case, what I did would be safer.

What's the procedure to submit something to illumos-gate? I don't have an account on illumos.org <http://illumos.org/>, and have no desire to assume any particular role there.

> On Sep 21, 2021, at 09:03, Andy Fiddaman <andy at omnios.org> wrote:
> 
> 
> 
> 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
> 
> 
> _______________________________________________
> openindiana-discuss mailing list
> openindiana-discuss at openindiana.org
> https://openindiana.org/mailman/listinfo/openindiana-discuss
> 

-- 
eMail:				mailto:rlhamil at smart.net






More information about the openindiana-discuss mailing list