Possible DNS problem (truss)
Posted in 2011
AIX 5
IDS 10
Ok, this is what I did:
1. I opened 2 telnet sessions
2. On the 1st I connected to the database (using a tcp connection and
dbaccess) - "dbaccess <databasename>"
3. On the 2nd, I got the PID for the 1st session, and did a truss on that PID,
and below is what I found.
truss: 0915-023 Cannot control process #602984.
680782: _poll(0x0000000000000000, 0, 0) (sleeping...)
680782: _poll(0x0000000000000000, 0, 0) = 0
680782: close(7) = 0
680782: socket(2, 2, 0) = 7
680782: sendto(7, 0x0FFFFFFFFFFF9190, 24, 0, 0x09001000A0015AB8, 16) = 24
680782: _poll(0x0FFFFFFFFFFF8330, 1, 5000) (sleeping...)
680782: _poll(0x0FFFFFFFFFFF8330, 1, 5000) = 0
680782: close(7) = 0
680782: socket(2, 2, 0) = 7
680782: sendto(7, 0x0FFFFFFFFFFF9190, 24, 0, 0x09001000A0015AB8, 16) = 24
680782: _poll(0x0FFFFFFFFFFF8330, 1, 10000) (sleeping...)
680782: _poll(0x0FFFFFFFFFFF8330, 1, 10000) = 0
680782: close(7) = 0
680782: socket(2, 2, 0) = 7
680782: sendto(7, 0x0FFFFFFFFFFF9190, 24, 0, 0x09001000A0015AB8, 16) = 24
680782: _poll(0x0FFFFFFFFFFF8330, 1, 20000) (sleeping...)
680782: _poll(0x0FFFFFFFFFFF8330, 1, 20000) = 0
680782: close(7) = 0
680782: close(6) = 0
The truss runs up to here, and then hangs for 30 seconds. And then suddenly,
when the 1st session connects, it continues as follows:
680782: open("/etc/hosts", O_RDONLY) = 6
680782: kioctl(6, 22528, 0x0000000000000000, 0x0000000000000000) = -1
680782: kfcntl(6, F_SETFD, 0x0000000000000001) = 0
680782: kioctl(6, 22528, 0x0000000000000000, 0x0000000000000000) = -1
680782: kread(6, " # I n t e r n e t A".., 4096) = 640
680782: kread(6, " # I n t e r n e t A".., 4096) = 0
680782: close(6) = 0
680782: socket(24, 1, 0) = 6
680782: kfcntl(6, F_GETFL, 0x0000000000000000) = 2
680782: kioctl(6, -2147195266, 0x0FFFFFFFFFFFC300, 0x0000000000000000) = 0
680782: kioctl(6, -2147195267, 0x0FFFFFFFFFFFC300, 0x0000000000000000) = 0
680782: kfcntl(6, F_SETFL, 0x0000000000008002) = 0
680782: getsockopt(6, 65535, 4104, 0x0FFFFFFFFFFFC434, 0x0FFFFFFFFFFFC430) = 0
680782: connext(6, 0x00000001100D0C90, 28) = 0
680782: kioctl(6, -2147195266, 0x0FFFFFFFFFFFC300, 0x0000000000000000) = 0
680782: kioctl(6, -2147195267, 0x0FFFFFFFFFFFC300, 0x0000000000000000) = 0
680782: kfcntl(6, F_SETFL, 0x0000000000000012) = 0
680782: setsockopt(6, 65535, 4, 0x0FFFFFFFFFFFC410, 4) = 0
680782: setsockopt(6, 65535, 8, 0x0FFFFFFFFFFFC410, 4) = 0
680782: setsockopt(6, 65535, 128, 0x0FFFFFFFFFFFC418, 8) = 0
680782: setsockopt(6, 6, 1, 0x0FFFFFFFFFFFC410, 4) = 0
680782: send(6, 0x00000001100E9430, 391, 0) = 391
680782: recv(6, 0x00000001100ED450, 16384, 0) = 271
680782: send(6, 0x00000001100E9430, 14, 0) = 14
680782: recv(6, 0x00000001100ED450, 16384, 0) = 14
680782: send(6, 0x00000001100E9430, 442, 0) = 442
680782: recv(6, 0x00000001100ED450, 16384, 0) = 2
680782: send(6, 0x00000001100E9430, 28, 0) = 28
680782: recv(6, 0x00000001100ED450, 16384, 0) = 46
680782: kwrite(1, "1B [ ? 1 h1B [ H1B [ 2 J".., 38) = 38
680782: send(6, 0x00000001100E9430, 8, 0) = 8
680782: recv(6, 0x00000001100ED450, 16384, 0) = 28
680782: access("eppix.dbs", 0) = -1
680782: access("./eppix.dbs", 0) = -1
680782: access("/usr/informix/msg/en_us/0333/sql.iem", 04) = 0
680782: close(3) = 0
680782: open("/usr/informix/msg/en_us/0333/sql.iem", O_RDONLY|O_LARGEFILE) = 3
680782: kread(3, " þ h068C", 4) = 4
680782: klseek(3, 6700, 0, 0x0FFFFFFFFFFFD580) = 0
680782: kread(3, " ý F\\\\0 H\\\\0\\\\088 × ý G\\\\0 #".., 64) = 64
680782: klseek(3, 10084, 0, 0x0FFFFFFFFFFFD580) = 0
680782: kread(3, " þ õ\\\\0 <\\\\0\\\\0 ? · þ ö\\\\0 2".., 64) = 64
680782: klseek(3, 11772, 0, 0x0FFFFFFFFFFFD580) = 0
680782: kread(3, "03 \\\\011\\\\0\\\\0 ¸ q03 ¡\\\\00F".., 64) = 64
680782: klseek(3, 10956, 0, 0x0FFFFFFFFFFFD580) = 0
680782: kread(3, "03 6\\\\00F\\\\0\\\\0 ° h03 9\\\\00F".., 64) = 64
680782: klseek(3, 10548, 0, 0x0FFFFFFFFFFFD580) = 0
680782: kread(3, " ÿ /\\\\01E\\\\0\\\\0 6 K ÿ 0\\\\0 2".., 64) = 64
680782: klseek(3, 10780, 0, 0x0FFFFFFFFFFFD580) = 0
680782: kread(3, "031D\\\\014\\\\0\\\\0 ® ½031E\\\\012".., 64) = 64
680782: klseek(3, 44789, 0, 0x0FFFFFFFFFFFD4D0) = 0
680782: kread(3, " D a t a b a s e s e l".., 19) = 19
680782: kwrite(1, "1B [ 2 4 ; 2 H D a t a b".., 25) = 25
680782: sigprocmask(0, 0x0000000000000000, 0x0000000110059340) = 0
680782: kwrite(1, "1B [ H1B [ 2 J D B A C C".., 252) = 252
680782: kread(0, "\\\\0", 1) (sleeping...)
The problem is, I spoke to the Unix Admin, and he says that we resolve in
/etc/hosts (locally) first, and then only on DNS, whereas I thought it is
working the other way around.
My netsvc.conf file contains:
hosts=local, bind4, bind6
This confirms what the Unix Admin says, but if I read the truss output, then
it is not happening this way. What I read from the truss output (if I
understand it correctly), is that it tries to resolve the hostname
(PS. We are using a hostname in the sqlhosts file, and not an IP address).
So, after 30 seconds of trying to resolve the hostname, it opens the
/etc/hosts file, gets the IP, and connect. I am correct when I say this ?
Dirk
________________________________
NOTE: This e-mail message is subject to the MTN Group disclaimer see
http://www.mtn.co.za/SUPPORT/LEGAL/Pages/EmailDisclaimer.aspx