path_helper will not set MANPATH

Originally posted in the OS X 10.6 forum, since I didn't think of path_helper as "classical" *nix...but this was suggested as a potentially better forum.

For some reason, path_helper has stopped setting the MANPATH variable for login shells...and I have no clue why.

It still sets the PATH variable - in fact, if run from the command line, i get this output:

$ /usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin:/usr/tex bin:/usr/X11/bin"; export PATH;
$
path_helper should be picking up the contents of /etc/manpaths and /etc/manpaths.d and displaying another line setting and exporting the MANPATH.

/etc/manpaths and /etc/manpaths.d/ exist and have appropriate permissions (root:wheel 644 on the files and 755 on the dirs). I'm at a loss as to why its not doing its job properly.

Of couse, a workaround is simple enough, since I can just add the MANPATH manually to the .bash_profile files for my accounts (or even to /etc/profile), but that's not how its supposed to work anymore, so I'd like to get things working properly if possible.

MacBook Pro, Mac OS X (10.6.1)

Posted on Oct 5, 2009 5:52 AM

Reply
17 replies

Nov 17, 2009 4:04 AM in response to B_Farrell

Placing "export MANPATH" in /etc/profile does nothing to alleviate this problem

I'm very sorry, I only checked it in my shell (zsh); in bash we need "export MANPATH=".
So MANPATH is already set, unless /etc/manpath is blank or does not exist.

This may be a possible interpretation of the man page. To me, however, if path_helper sets the default value of MANPATH even if it is not exist in the environment, then the description like
(The MANPATH environment variable will not be modified unless it is already set in the environment.)
would look rather pointless. So I thought default value is not set if MANPATH is not set in the environment (and path_helper is indeed programed in this way). But, yes, you may think the man page is rather ambiguous (or broken). Please send your feedback/bug report to Apple at http://www.apple.com/feedback/; this is the only way to make Apple aware of the problem (they are not reading this Discussion).
You also mention that AUTOPATH does not work for /usr/local/man

I think this is due to the following line in man.conf:
MANPATH_MAP /usr/local/bin /usr/local/share/man
Even if /usr/local/bin is in your PATH, /usr/local/share/man is searched instead of /usr/local/man.

I can fully understand your frustration, since I had the same problem a few years ago. Some software install their man page into /usr/local/man, some others into /usr/local/share/man. My workaround is
ln -s /usr/local/share/man /usr/local/man
before installing any manpages in /usr/local/man. Of course you have already installed man pages in /usr/local/man, so you need to move them to /usr/lcoal/share/man. I know this is not a satisfatcoty solution.

If you want, you can download the source code of path_helper from
http://www.opensource.apple.com/release/mac-os-x-1062/
It is in shell_cmds-149; it's a simple program, and you can modify it as you like.

Nov 17, 2009 10:59 AM in response to Jun T.

Thank you for your clarification Jun - this is very helpful. I apologize if my last post was a bit rude - it was getting late and I was really frustrated at that point !

I removed my 'MANPATH /usr/local/man' entry from man.conf. I then added 'export MANPATH=' to /etc/profile before path_helper is called (sorry - I should have picked-up on the '=' sign for bash as well):

# System-wide .profile for sh(1)
export MANPATH=
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi


I placed the 'growl' file with '/usr/local/man' into manpaths.d . Once I started a new shell, path_helper and man worked as expected.

This method of modifying PATH and MANPATH is strange. After reading more on the subject by running a Google search for path_helper, I can sort of understand why Apple implemented this, but unfortunately, their documentation on it is pretty poor. I can now see how you read the path_helper man page and understand the part in parenthesis +(The MANPATH environment variable will not be modified unless it is already set in the environment.)+ This is not a very clear statement however (given other statements on that very same page) and seems to contradict the description of MANPATH under the ENVIRONMENT section of the man man page:

ENVIRONMENT

MANPATH

If MANPATH is set, man uses it as the path to search for manual page

files. It overrides the configuration file and the automatic search
path,
but is overridden by the -M invocation option. See SEARCH PATH

FOR MANUAL PAGES.


*I will call this to Apple's attention, as you suggest - thanks for the info !*

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

path_helper will not set MANPATH

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.