2

I have written my own manpage, but as it is going to be present on a large number of company computers and I want to update it often, I would like it to be situated in folder shared between these computers.

Therefore, I have added this folder to manpath, using /etc/man.config - when I type manpath in a terminal, I get the following output: /usr/local/share/man:/usr/share/man/overrides:/usr/share/man/en:/usr/share/man:/online/RCCARS/compass-rccars-daq-documentation.

This is correct, the last path is the one I want my manpage to be situated in. The problem is, this path is being ignored for some reason. When I type man my_program, I get No manual entry for my_program. If I put my manpage file into one of the other paths instead (for example /usr/local/share/man), the manpage displays properly following the man my_program command. What am I doing wrong?

Below is my /etc/man.config :

#
# Generated automatically from man.conf.in by the
# configure script.
#
# man.conf from man-1.6f
#
# For more information about this file, see the man pages man(1)
# and man.conf(5).
#
# This file is read by man to configure the default manpath (also used
# when MANPATH contains an empty substring), to find out where the cat
# pages corresponding to given man pages should be stored,
# and to map each PATH element to a manpath element.
# It may also record the pathname of the man binary. [This is unused.]
# The format is:
#
# MANBIN        pathname
# MANPATH       manpath_element [corresponding_catdir]
# MANPATH_MAP       path_element    manpath_element
#
# If no catdir is given, it is assumed to be equal to the mandir
# (so that this dir has both man1 etc. and cat1 etc. subdirs).
# This is the traditional Unix setup.
# Certain versions of the FSSTND recommend putting formatted versions
# of /usr/.../man/manx/page.x into /var/catman/.../catx/page.x.
# The keyword FSSTND will cause this behaviour.
# Certain versions of the FHS recommend putting formatted versions of
# /usr/.../share/man/[locale/]manx/page.x into
# /var/cache/man/.../[locale/]catx/page.x.
# The keyword FHS will cause this behaviour (and overrides FSSTND).
# Explicitly given catdirs override.
#
# FSSTND
FHS
#
# This file is also read by man in order to find how to call nroff, less, etc.,
# and to determine the correspondence between extensions and decompressors.
#
# MANBIN        /usr/local/bin/man
#
# Every automatically generated MANPATH includes these fields
#
MANPATH /usr/man
MANPATH /usr/share/man
MANPATH /usr/local/man
MANPATH /usr/local/share/man
MANPATH /usr/X11R6/man
MANPATH /online/RCCARS/compass-rccars-daq-documentation
#
# Uncomment if you want to include one of these by default
#
# MANPATH   /opt/*/man
# MANPATH   /usr/lib/*/man
# MANPATH   /usr/share/*/man
# MANPATH   /usr/kerberos/man
#
# Set up PATH to MANPATH mapping
#
# If people ask for "man foo" and have "/dir/bin/foo" in their PATH
# and the docs are found in "/dir/man", then no mapping is required.
#
# The below mappings are superfluous when the right hand side is
# in the mandatory manpath already, but will keep man from statting
# lots of other nearby files and directories.
#
MANPATH_MAP /bin            /usr/share/man
MANPATH_MAP /sbin           /usr/share/man
MANPATH_MAP /usr/bin        /usr/share/man
MANPATH_MAP /usr/sbin       /usr/share/man
MANPATH_MAP /usr/local/bin      /usr/local/share/man
MANPATH_MAP /usr/local/sbin     /usr/local/share/man
MANPATH_MAP /usr/X11R6/bin      /usr/X11R6/man
MANPATH_MAP /usr/bin/X11        /usr/X11R6/man
MANPATH_MAP /usr/bin/mh     /usr/share/man
#
# NOAUTOPATH keeps man from automatically adding directories that look like
# manual page directories to the path.
#
#NOAUTOPATH
#
# NOCACHE keeps man from creating cache pages ("cat pages")
# (generally one enables/disable cat page creation by creating/deleting
# the directory they would live in - man never does mkdir)
# 
#NOCACHE
#
# Useful paths - note that COL should not be defined when
# NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
# not only is it superfluous, but it actually damages the output.
# For use with utf-8, NROFF should be "nroff -mandoc" without -T option.
# (Maybe - but today I need -Tlatin1 to prevent double conversion to utf8.)
#
# If you have a new troff (version 1.18.1?) and its colored output
# causes problems, add the -c option to TROFF, NROFF.
#
TROFF       /usr/bin/groff -Tps -mandoc
NROFF       /usr/bin/nroff -c -mandoc 2>/dev/null
EQN     /usr/bin/geqn -Tps
NEQN        /usr/bin/geqn -Tutf8
TBL     /usr/bin/gtbl
# COL       /usr/bin/col
REFER       /usr/bin/grefer
PIC     /usr/bin/gpic
VGRIND      
GRAP        
PAGER       /usr/bin/less -is
BROWSER     /usr/bin/less -is
HTMLPAGER   /bin/cat
CAT     /bin/cat
#
# The command "man -a xyzzy" will show all man pages for xyzzy.
# When CMP is defined man will try to avoid showing the same
# text twice. (But compressed pages compare unequal.)
#
CMP     /usr/libexec/man-cmp.sh
#
# Compress cat pages
#
COMPRESS    /usr/bin/lzma
COMPRESS_EXT    .lzma
#
# Default manual sections (and order) to search if -S is not specified
# and the MANSECT environment variable is not set (1x-8x sections are used by
# xorg packages).
#
MANSECT     1:1p:8:2:3:3p:4:5:6:7:9:0p:n:l:p:o:1x:2x:3x:4x:5x:6x:7x:8x
#
# Default options to use when man is invoked without options
# This is mainly for the benefit of those that think -a should be the default
# Note that some systems have /usr/man/allman, causing pages to be shown twice.
#
#MANDEFOPTIONS  -a
#
# Decompress with given decompressor when input file has given extension
# The command given must act as a filter.
#
.gz     /usr/bin/gunzip -c
.bz2        /usr/bin/bzip2 -c -d
.lzma       /usr/bin/unlzma -c -d
.z      
.Z      /bin/zcat
.F      
.Y      
#
# Enable/disable makewhatis database cron updates.
# If MAKEWHATISDBUPDATES variable is uncommented
# and set to n or N, cron scripts 
# /etc/cron.daily/makewhatis.cron
# /etc/cron.weekly/makewhatis.cron
# will not update makewhatis database.
# Otherwise the database will be updated.
# 
#MAKEWHATISDBUPDATES    n
  • What's the full path to the manpage file you created? Does running man -u help or produce interesting output? – Gilles Aug 6 '17 at 23:55
  • The full path is /online/RCCARS/compass-rccars-daq-documentation/CLI.1.gz . – user129186 Aug 7 '17 at 8:12
  • Running man -u returns "invalid option" and prints help. – user129186 Aug 7 '17 at 8:13
  • Ah. What unix variant are you running? What man implementation does it use — maybe you have a /usr/bin/man that has a different configuration from /usr/local/bin/man or something? – Gilles Aug 7 '17 at 9:00
  • The PC is running SLC6. Running which man returns /usr/bin/man. There's no man binary in /usr/local/bin. I'm not sure how to find out which man implementation it uses - upon asking for help, I get a "man, version 1.6f" header. – user129186 Aug 7 '17 at 9:11
2

Each directory in MANPATH is the root of a manual page hierarchy. Under that directory are one or more mansection directories1, such as man1, and in each of those directories there are zero or more troff source files named commandname.section, possibly with an added .Z or .gz suffix, in your case CLI.1.gz.

So if your man.config has a line

MANPATH /online/RCCARS/compass-rccars-daq-documentation

then you'd copy your man page troff source code to a path such as

/online/RCCARS/compass-rccars-daq-documentation/man1/CLI.1.g‌​z

[1] Depending on your OS, you may also have catsection, fmtsection, and smansection directories.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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