Date: Sun, 24 Nov 2002 16:34:27 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: freebsd-questions@FreeBSD.ORG Subject: Re: lsof: help understanding output Message-ID: <20021124163427.GC22014@happy-idiot-talk.infracaninophi> In-Reply-To: <3DE0E9B9.9060104@intersonic.se> References: <3DE0E9B9.9060104@intersonic.se>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 24, 2002 at 04:01:13PM +0100, Per olof Ljungmark wrote:
> I installed the BIND daemon as chroot to /chroot/mamed,
> does the following lsof output show that named is not chroot'ed?
>
> FreeBSD 4.6.2, BIND 9.2.1
>
> syslogd 80 root 4u unix 0xca5d0e00 0t0
> /chroot/named/dev/log
> named 470 named cwd VDIR 13,131072 512 16715
> /chroot/named/etc/namedb
> named 470 named rtd VDIR 13,131072 512 16305 /chroot/named
> named 470 named txt VREG 13,131072 3337414 16966
> /chroot/named/named
> named 470 named txt VREG 13,131079 80756 175176
> /usr/libexec/ld-elf.so.1
> named 470 named txt VREG 13,131079 580520 336941
> /usr/lib/libc.so.4
> named 470 named 0u VCHR 2,2 0t0 16948
> /chroot/named/dev/null (like character special /dev/null)
> named 470 named 1u VCHR 2,2 0t0 16948
> /chroot/named/dev/null (like character special /dev/null)
> named 470 named 2u VCHR 2,2 0t0 16948
> /chroot/named/dev/null (like character special /dev/null)
> named 470 named 3u unix 0xca5d0bc0 0t0 ->0xca5d0ec0
> named 470 named 4u IPv4 0xca65fc80 0t0 UDP
> candyman.i.inter-sonic.com:domain
> named 470 named 5u IPv4 0xca6eee80 0t0 TCP
> candyman.i.inter-sonic.com:domain (LISTEN)
> named 470 named 6u IPv4 0xca65fb00 0t0 UDP
> localhost.i.inter-sonic.com:domain
> named 470 named 7u IPv4 0xca6eec60 0t0 TCP
> localhost.i.inter-sonic.com:domain (LISTEN)
> named 470 named 8u IPv4 0xca65fa40 0t0 UDP *:domain
> named 470 named 9u IPv6 0xca65fbc0 0t0 UDP *:1064
> named 470 named 10r VCHR 2,3 0t0 16949
> /chroot/named/dev/random (like character special /dev/random)
No --- that's fine. named dynamically links against libc.so.4 before
the call to chroot(2), so you don't need to copy great chunks of
/usr/lib into your chroot area. Then when it daemonizes, it reopens
file descriptors 0, 1, 2 onto /dev/null (SOP for a well behaved daemon
process: see daemon(3)), and you can see that because of the chroot(2)
call, it's actually redirecting to /chroot/named/dev/null.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks
Savill Way
Marlow
Tel: +44 1628 476614 Bucks., SL7 1TH UK
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021124163427.GC22014>
