0

On a Scientific Linux 5.5 installation the $MANPATH is not set. I've got environment modules installed, this might cause an overwriting of the $MANPATH, but I'm not sure about that. So my main question is: At which point is the /etc/man.config interpreted to form the $MANPATH? Does it the bash-shell by itself (hardcoded) or is it a file that is sourced at logintime, e.g. /etc/profile? I can't find any dependency under /etc in any file for /etc/man.config.

This reason why I think the environment modules are messing with the $MANPATH is that after logging in to the system the only entry is:

# manpath 
/cm/local/apps/environment-modules/3.2.6/man

EDIT:

In the meantime and regarding to the first answer I tried this:

# find . -type f -exec fgrep -l -i manpath {} \;
./profile.d/man.sh
./profile.d/man.csh
./man.config

Well, this is the content of

# cat /etc/profile.d/man.sh 
export MANPATH=:ignore:/cm/local/apps/environment-modules/3.2.6/man

If I remove this file, at least "/usr/man" appears in the $MANPATH, but this is only the tip of the iceberg of what is defined in the /etc/man.config . So I think /etc/man.config is still not completely handled. Changing /etc/profile.d/man.sh to the following had no effect:

# cat /etc/profile.d/man.sh 
export MANPATH=:ignore:/cm/local/apps/environment-modules/3.2.6/man:$MANPATH
# echo $MANPATH 
ignore:/cm/local/apps/environment-modules/3.2.6/man:
1

This is the solution: If $MANPATH is set, the default paths for manualpages get overwritten. So unsetting $MANPATH reveals the default path, just execute the command "manpath":

/usr/local/share/man:/usr/share/man/en:/usr/share/man:/usr/man:/usr/local/man

The content of /etc/profile.d/man.sh is also correct, because a leading colon in the $MANPATH variable will prevent overwriting the default manpath! This is the actual solution to my problem, because one environment module prepended a manual path to the $MANPATH variable without the leading colon and because of that default man pages were not available anymore.

  • Actually a trailing colon is a better option. That way your MANPATH is added to start of the standard path rather than to the end, which is useful if you are adding a newer version of an existing program to the path, you get the new version of the man page as well as the new version of the program. – Mark Booth Mar 22 '16 at 17:29
0

Well, although I am writing in the Your Answer field, I do not know THE answer, I just know a meta-answer which can be utilized whenever this kind of "in what config file is it mangled?" pops up.

Install midnight commander if you haven't done it yet. Start mc in /etc:

mc /etc

start Find File dialog by F9,c,f or Alt-? or Meta-? (if Alt is not your Meta)

let Start at: be a . (single dot) as default, let File name: be * as default, and let Content: be MANPATH.

Search for content should be checked and First hit should not.

Just let the search finish and in the dialog you will see all the occurrences of MANPATH in all files where it's written. You can browse and judge what makes your life harder.

Basically, it's the same as if you would run rgrep on /etc looking for MANPATH and read its output, just a lot handier IMHO.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.