Re: chroot and hostname resolution problem [was : Re: [syslog-ng]centralized
Gregor Binder wrote :
Hi,
doing 'strace /etc/init.d/syslog-ng start', I can't find something strange,
I don't know about Linux/strace, but on most systems, you would have to use an option to the tracing utility to trace calls of child
-- man strace -- -f Trace child processes as they are created by currently traced processes as a result of the fork(2) system call. -- man strace --
processes. Looks to me like you are tracing the shell process only.
Try to run the syslog-ng BINARY from strace, and look for problems like Ed suggested.
8254 open("/lib/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) 8254 open("/lib/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) and I suppose those libs are needed by the resolver ... Why 'ldd syslog-ng' does not reported this two files ? (nor ldd on the libs returned by the previous commands) How could I 'guessed' that I need to copy this files into the jail ?
Is there someone who is running a chrooted syslog-ng running under a non root user as a log collector without any (hostname resolution)
problem
? I am - but I have "use_dns(no)" in my config.
Same here. I don't see any technical reason why this wouldn't work, unless you are missing resolv libraries (e.g. on Solaris) or supplementary configuration files in the jail.
Gregor.
Now my syslog-ng is resolving almost as I want : Althougt my $JAIL/etc/nsswitch.conf contains "hosts dns", hostnames are only resolved if they are in $JAIL/etc/hosts ! Amazing ... I'll continue debugging, I progress ;-)
Msg from Guillaume LACHENAL: Hi Guillaume,
and I suppose those libs are needed by the resolver ...
most likely :)
Why 'ldd syslog-ng' does not reported this two files ? (nor ldd on the libs returned by the previous commands)
You might find them if you continue to search recursively through the results.
How could I 'guessed' that I need to copy this files into the jail ?
I've set up quite a few chroots for all kinds of services. Experience says, that guessing (i.e. trying to figure out in advance) will usually only save you the first few trace-sessions but almost never make the chrooted service work 100% right away.
Althougt my $JAIL/etc/nsswitch.conf contains "hosts dns", hostnames are only resolved if they are in $JAIL/etc/hosts ! Amazing ...
As you seem to start having fun with process tracing, try to find out where resolving fails, or if it is attempted at all. Regards, Gregor.
On Wed, Nov 06, 2002 at 01:48:31PM +0100, Guillaume LACHENAL wrote:
Gregor Binder wrote : 8254 open("/lib/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) 8254 open("/lib/libnss_dns.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
and I suppose those libs are needed by the resolver ...
Why 'ldd syslog-ng' does not reported this two files ? (nor ldd on the libs returned by the previous commands)
How could I 'guessed' that I need to copy this files into the jail ?
by using strace ;) those files are loaded dynamically by the libc based on the contents of nsswitch.conf
Now my syslog-ng is resolving almost as I want :
Althougt my $JAIL/etc/nsswitch.conf contains "hosts dns", hostnames are only resolved if they are in $JAIL/etc/hosts ! Amazing ...
I'll continue debugging, I progress ;-)
do you have resolv.conf/host.conf ? -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
participants (3)
-
Balazs Scheidler
-
Gregor Binder
-
Guillaume LACHENAL