man not working within chroot
H iI was wondering if any can help, I just can seem to get man commanf to work properly within a chroot (im using jailkit), the command works but it does not pull any information.. I tried debugging using strace and i get the following result from strace on the chrooted man command and normal enviroment
Jailkit open("/etc/ld.so.cache", O_RDONLY) = 4 open("/lib/libc.so.6", O_RDONLY) = 4 open("/etc/man.config", O_RDONLY) = 4 open("/usr/share/locale/C/man", O_RDONLY) = 5 Process 26204 detached % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- nan 0.000000 0 4 read nan 0.000000 0 1 write nan 0.000000 0 4 open nan 0.000000 0 3 close nan 0.000000 0 1 execve nan 0.000000 0 1 1 access nan 0.000000 0 4 brk nan 0.000000 0 3 ioctl nan 0.000000 0 6 old_mmap nan 0.000000 0 1 munmap nan 0.000000 0 2 mprotect nan 0.000000 0 2 mmap2 nan 0.000000 0 4 fstat64 nan 0.000000 0 1 getuid32 nan 0.000000 0 1 getgid32 nan 0.000000 0 1 geteuid32 nan 0.000000 0 1 getegid32 nan 0.000000 0 1 set_thread_area ------ ----------- ----------- --------- --------- ---------------- 100.00 0.000000 41 1 total real life open("/etc/ld.so.cache", O_RDONLY) = 3 open("/lib/libc.so.6", O_RDONLY) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 open("/etc/man.config", O_RDONLY) = 3 open("/usr/share/locale/en/man", O_RDONLY) = 4 % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- nan 0.000000 0 4 read nan 0.000000 0 1 write nan 0.000000 0 7 2 open nan 0.000000 0 4 close nan 0.000000 0 1 execve nan 0.000000 0 1 1 access nan 0.000000 0 4 brk nan 0.000000 0 3 ioctl nan 0.000000 0 6 old_mmap nan 0.000000 0 1 munmap nan 0.000000 0 2 mprotect nan 0.000000 0 3 mmap2 nan 0.000000 0 5 fstat64 nan 0.000000 0 1 getuid32 nan 0.000000 0 1 getgid32 nan 0.000000 0 1 geteuid32 nan 0.000000 0 1 getegid32 nan 0.000000 0 1 set_thread_area ------ ----------- ----------- --------- --------- ---------------- 100.00 0.000000 47 3 total |
Do you have the needed libraries and a copy of the /usr/share/man hierarchy and man.conf in the jailed environment. I think you also need to check the man.conf file. You may be missing some commands like gzip which man needs to uncompress man pages. Also check for the other programs mentioned in man.conf like groff, etc.
|
All of them seem to be there.. that's what confusing me. I've also notice strace has gives different numbers for the output. they are mainly 3 in the non-chroot environment and 4's in the chroot.. I've search and i can't find any documentation that indicates what the output numbers are ( i know 0 indicates the file cant be found)..
|
Does anyone know what the strace return value of 4 actually means?
|
ldd /usr/bin/man might be eaiser to find out what libraries are required.
"ldd - print shared library dependencies" |
this was the output
linux-gate.so.1 => (0xffffe000) libc.so.6 => /lib/libc.so.6 (0xb7dbd000) /lib/ld-linux.so.2 (0xb7eee000) running locate, they both seem to be there, (below) chroot/lib/libc.so.6 chroot/lib/ld-linux.so.2 If im correct in my read linux-gate.so.1 is not actually a libary, its a it's a virtual DSO? In fact man actually loads ok it just does no pull any info into the screen if you do ie man ls, all the programs that man seem to you use in config file are also installed |
you also need to copy the man pages into there. i think they are in /usr/share/man
|
All times are GMT -5. The time now is 11:41 PM. |