Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sure-fire man update method
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
danboston
n00b
n00b


Joined: 17 Nov 2016
Posts: 47

PostPosted: Sat Mar 04, 2017 1:34 pm    Post subject: sure-fire man update method Reply with quote

So I had this happen again (in this example, I am demonstrating that the "git" program exists yet man cannot (or refuses to) see the man page:
Code:

~$ apropos git | cut -c -70  | grep "git " | head -n 3
git (1)              - the stupid content tracker
git-remote-testgit (1) - Example remote-helper
git-shortlog (1)     - Summarize 'git log' output
~$ man git
No manual entry for git

Program exists. Man cannot find the man page. I've used various commands in various distros to refresh this and they all have this in common: they work once then something changes.

Please, what is the best sure-fire never-change set-once-and-forget method of forcing man pages to be updated?

Thank you.
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Sat Mar 04, 2017 2:13 pm    Post subject: Reply with quote

Short answer, periodically run `makewhatis -w`

Longer answer ...

There are a few possible ways the "whatis" database can get out of rig with the information on your system.

You probably have a file, /etc/cron.daily/makewhatis

If you have that, and you have cron running, and cron picks up and runs the files in /etc/cron.daily, then once a day, the command `makewhatis -u` is run. This adds new manpages to the whatis database, but does not remove entries for manpages that no longer exist. That is how apropos (which looks only at the database) reports a manpage, but man can't read a manpage, because there is no manpage.

I believe that Gentoo also runs `makewhatis -u` after installing every package. The command will be found in /etc/portage/bashrc -- I say "I believe on this only because I have modified /etc/portage/bashrc on my systems, and the original code is no longer operative. I don't care if the whatis database is updated "instantly," once a day is fine by me.

Back to the case of the whatis database having more entries than there are manpages, I had to manually add a periodic job to my cron routines, running `makewhatis -w` That runs only once a month, not that it takes very long either, it's just how I set things up. That cleans out the deadwood in the whatis database. I stuck that command in a homebrew cronjob that cleans the distfiles directory of deadwood package tarballs.

It is also possible to have a manpage, but even `makewhatis -w` doesn't add it to its database. The variable MANPATH has to account for all the places that makewhatis is supposed to search. I doubt your MANPATH is out of shape for a man page dedicated to the git programs.

MANPATH is set by entries in multiple files in /etc/env.d, and if not set there, see /etc/man.conf

Edit to add a few remarks about manpages for git. They are installed in directories off of /usr/share/man. I have 169 manpages relating to git, they are there ... `locate -r /man.*/git` I tested the man1/git.1 file, and it (and probably all the others) was installed by emerging git. I add this because you say you have git, but no manpages for git. If that is true, something is happening during the emerge process.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Mar 04, 2017 6:45 pm    Post subject: Reply with quote

Are you using sys-apps/man-db or sys-apps/man? The latter is poorly maintained and you should switch, if it's the former then running `su -c /etc/cron.daily/man-db` should fix the problem.
Back to top
View user's profile Send private message
danboston
n00b
n00b


Joined: 17 Nov 2016
Posts: 47

PostPosted: Mon Mar 06, 2017 2:44 am    Post subject: Reply with quote

Thanks for the replies.

Turns out things are wonkier than expected (as root):
Code:

~# makewhatis -w
-su: makewhatis: command not found
~#

Off to emerge stuff ...

EDIT. Then it gets weirder:
Code:

~# e-file makewhatis
 *  dev-lang/erlang
        Available Versions:     19.2 15.2.3.1 15.2.1 13.2.4 19.1 19.0 18.3 18.2.1 18.0-r2 18.0-r1 18.0 17.5 17.3
        Homepage:               http://www.erlang.org/
        Description:            Erlang programming language, runtime environment and libraries (OTP)
        Matched Files:          /usr/lib64/erlang/misc/makewhatis; /usr/lib/erlang/misc/makewhatis;

 *  sys-freebsd/freebsd-ubin
        Available Versions:     10.3-r1
        Description:            FreeBSD's base system source for /usr/bin
        Matched Files:          /usr/bin/makewhatis;

[I] sys-apps/man
        Available Versions:     1.6g-r1 1.6g 1.6f-r4 1.6f-r1
        Last Installed Ver:     db-2.7.6.1-r1(Tue 10 Jan 2017 06:50:17 PM EST)
        Homepage:               http://primates.ximian.com/~flucifredi/man/
        Description:            Standard commands to read man pages
        Matched Files:          /usr/sbin/makewhatis; /etc/cron.daily/makewhatis;

~#

Apparently makewhatis is part of the man package, which I have installed. So it shoudl be there. But it is not. Connnnntradiction!

edit2: @Ant P. I see your post. Will be following up on that info next.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Mar 06, 2017 12:19 pm    Post subject: Reply with quote

danboston wrote:
Code:
~# makewhatis -w
-su: makewhatis: command not found

danboston ... when using 'su' make the shell a login shell (via 'su -', '-l' or '--login') otherwise you retain the PATH from the invoking shell. The default PATH for non-root doesn't contain {/usr,}/sbin (see: /etc/profile) hence makewhatis (sys-apps/man's /usr/sbin/makewhatis) isn't found in (the invoking users) PATH.

best ... khay
Back to top
View user's profile Send private message
danboston
n00b
n00b


Joined: 17 Nov 2016
Posts: 47

PostPosted: Mon Mar 06, 2017 1:31 pm    Post subject: Reply with quote

khayyam wrote:
danboston wrote:
Code:
~# makewhatis -w
-su: makewhatis: command not found

danboston ... when using 'su' make the shell a login shell (via 'su -', '-l' or '--login') otherwise you retain the PATH from the invoking shell. The default PATH for non-root doesn't contain {/usr,}/sbin (see: /etc/profile) hence makewhatis (sys-apps/man's /usr/sbin/makewhatis) isn't found in (the invoking users) PATH.

best ... khay

But that is what is so insane. I'm already root when I type the above. Not sure how the su is getting into that error message.
Code:

~# makewhatis
-su: makewhatis: command not found
~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.4:/root:/root/s:/root/c
~# whoami
root
~#

A massive search using a find revealed a partial answer: there is no makewhatis program on my system. That explains things, I guess. We'll just say that makewhatis was deprecated some time ago and leave it at that.

Ant P: your idea worked. Thank you very much.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum