Hello, I’m no expert with Linux man page configuration, but I spent quite a bit of time recently trying to understand why my package man pages aren’t rendering correctly on any of my Resin devices. While I show an example of the issue on one of my devices, this isn’t specific to a particular device or image; I’ve never had man pages working properly. Suspecting the package ordering, I even tried installing ‘man-db’ and ‘manpages’ in a Dockerfile step prior to all the other system packages, but this didn’t help.
Have you seen this problem before?
Dockerfile excerpt:
FROM resin/raspberrypi3-debian:latest
...
RUN apt-get ... \
...
man-db \
manpages \
...
My attempt at debugging the issue follows. My gut tells me that this is more about the ability of the renderer (less) to function correctly because all evidence suggests that the man tool correctly locates the physical man pages and traverses the section numbers properly.
root@pi:~# manpath
/usr/local/man:/usr/local/share/man:/usr/share/man
root@pi:~# mandb
Purging old database entries in /usr/share/man...
Processing manual pages under /usr/share/man...
Purging old database entries in /usr/share/man/cs...
Processing manual pages under /usr/share/man/cs...
...
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.
root@pi:~#
root@pi:~# ls -l /usr/share/man/man1/grep.1.gz
-rw-r--r-- 1 root root 10001 Feb 14 2015 /usr/share/man/man1/grep.1.gz
root@pi:~# zgrep pattern /usr/share/man/man1/grep.1.gz
grep, egrep, fgrep, rgrep \- print lines matching a pattern
root@pi:~# man -d grep
...
From the config file /etc/manpath.config:
...
Mandatory mandir `/usr/share/man'.
...
ult_src: File /usr/share/man/man1/grep.1.gz in mantree /usr/share/man
found ultimate source file /usr/share/man/man1/grep.1.gz
...
chdir /usr/share/man
pre-processors `t' from default
page_encoding = ISO-8859-1
source_encoding = ISO-8859-1
locale_charset = ANSI_X3.4-1968
roff_device (locale) = ascii
roff_encoding = ANSI_X3.4-1968
output_encoding = ANSI_X3.4-1968
less_charset = ascii
Terminal width 168
Terminal width 168 not within cat page range [80, 80]
Using 163-character lines
formatted_encoding = ANSI_X3.4-1968
format: 1, save_cat: 0, found: 1
add_output_iconv: source ANSI_X3.4-1968, target ANSI_X3.4-1968
Setting LESS to -ix8RmPm Manual page grep(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page grep(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$
Setting MAN_PN to grep(1)
++priv_drop_count = 1
--priv_drop_count = 0
hashtable_free: 2 entries, 2 (100%) unique
Found 1 man pages
++priv_drop_count = 1
hashtable_free: 7 entries, 7 (100%) unique
The result: man page (blank page with footer):
Manual page grep(1) line ?/? (END) (press h for help or q to quit)
Thanks! I didn’t notice that. I’ll dig in and let you know. strace has a little more detail. I glossed over groff because groff-base was already installed as a transitive dependency. Will let you know what I discover, thanks again.
brk(0x56824000) = 0x56824000
open("/usr/share/groff/site-font/devps/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/groff/1.22.2/font/devps/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/font/devps/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "groff: can't find `DESC' file\n", 30groff: can't find `DESC' file
) = 30
write(2, "groff:fatal error: invalid devic"..., 39groff:fatal error: invalid device `ps'
) = 39
exit_group(3) = ?
+++ exited with 3 +++
root@pi:~#