1752794 Members
6479 Online
108789 Solutions
New Discussion юеВ

Socket permission issue

 
Jerome C
Occasional Advisor

Socket permission issue

Hello Everyone,

System HP IA 11.31
I am currently trying to run a process on a itanium box and get an error message as follow:

connect to /tmp/SocketStream.23451 failed error=Connection refused

The file is created under /tmp with a size of 0, as well permissions sounds ok (srwxsrwxsrwx) and owner is the user the process was run with.

In the ipcs the process appears with a "no-entry" for the D-TIME field.

Any help is welcome

Thanks for your help

Jerome

14 REPLIES 14
Laurent Menase
Honored Contributor

Re: Socket permission issue

usually just means that server side socket is not listening.
Jerome C
Occasional Advisor

Re: Socket permission issue

Thanks Laurent,


Definitely, problem is that the command i run should open the socket.

:(

Thanks

Jerome
Laurent Menase
Honored Contributor

Re: Socket permission issue

you need to find out server side socket owner process if you don't know it( with lsof for instance) - or may be it is process pid 23451
then tusc it to check it is well configured as a AF_UNIX/SOCK_STREAM and that bind() and listen() have been called on that socket.
Laurent Menase
Honored Contributor

Re: Socket permission issue

you can also try a netstat -an |grep SocketStream.23451
Jerome C
Occasional Advisor

Re: Socket permission issue

Thanks Laurent for precious informations.

FYI, i restarted process and bind to 9008.
I have been issuing the command you sent and can see the socket as follow in the netstat -an output:

e00000040f04e100 stream 0 0 e000000374c80380 0 0 0 /tmp/SocketStream.9008
e00000040f04e400 stream 90 0 0 e00000036ed09b80 0 0 /tmp/SocketStream.9008

I am also able to connect using "telnet localhost 9008" also using IP adress of server.

I have not access to tusc or lsof on this machine.


Thanks

Jerome



Laurent Menase
Honored Contributor

Re: Socket permission issue

telnet uses AF_INET socket and not AF_UNIX socket
so your telnet localhost 9008 connect to a socekt bound on AF_INET and not that /tmp/SockStream.9008

without lsof or tusc you won't make much progress.
Jerome C
Occasional Advisor

Re: Socket permission issue

Hi Laurent,

Thanks again.
Last lines of lsof are giving the following, user1 is the user i spawn process with and Program1 is the name of the process ran:
Program1 4163 user1 4u REG 64,0x30003 40960 65889 /oracle/product/11.1.0/db_1/rdbms/mesg/diaus.msb
Program1 4163 user1 5u REG 64,0x30003 25600 65970 /oracle/product/11.1.0/db_1/rdbms/mesg/ocius.msb
Program1 4163 user1 6u IPv6 0xe0000003763d2380 0t0 UDP [::1]:56386 (Idle)
Program1 4163 user1 7u IPv4 0xe00000036cb19d00 0t6034 TCP Machine1:50538->Machine1:1530 (ESTABLISHED)
Program1 4163 user1 8u IPv4 0xe0000003aed35a00 0t0 TCP *:* (IDLE)
Program1 4163 user1 9u REG 64,0x10001 608 90505 /usr/app/Program1/Program1ent.4163.10092916
Program1 4163 user1 10u IPv4 0xe000000376386380 0t0 TCP *:9008 (LISTEN)
Program1 4163 user1 11u unix 64,0x4 0t0 947 /tmp/SocketStream.9008 (0x6c85a980)
Program1 4163 user1 12u unix 0x682c4380 0t90 ->0xeb92d400

Thanks for your help

J├Г┬йr├Г┬┤me
Laurent Menase
Honored Contributor

Re: Socket permission issue

Are you using RBAC/containment?
are you sure of your program which tries to connect using AF_UNIX sockets?-
if you have tusc,
use "tusc -v -E" of your program to understand what can happen to your socket.

If it is not an application you will probably need to contact HP support.
Jerome C
Occasional Advisor

Re: Socket permission issue

Hi Laurent,

i ran tusc and get the following segment:

st_dev: 64 0x000003
st_ino: 1872
st_mode: S_IFREG|0444
st_nlink: 1
st_rdev: 0 0x000000
st_size: 8
st_blksize: 8192
st_blocks: 8
st_uid: 2
st_gid: 2
st_atime: Thu Sep 30 09:31:04 2010
st_mtime: Mon Aug 23 13:53:40 2010
st_ctime: Mon Aug 23 13:53:40 2010
read(10, 0x6000000000192f50, 8) .................................................................. [entry]
read(10, "G M T 0 B S T \n", 8) .................................................................. = 8
close(10) ........................................................................................ [entry]
close(10) ........................................................................................ = 0
open(0x600000000002abe0, O_WRONLY|O_APPEND|O_CREAT, 0666) ........................................ [entry]
open("./DConfigAgent.29605.10093009", O_WRONLY|O_APPEND|O_CREAT|0x800, 0666) ..................... = 10
write(10, 0x600000000029e410, 143) ............................................................... [entry]
write(10, "| 2 0 1 0 - 0 9 - 3 0 T 0 9 : 3 ".., 143) ............................................. = 143
brk(0x60000000002c0000) .......................................................................... [entry]
brk(0x60000000002c0000) .......................................................................... = 0
utssys(0x9fffffffbf7df4f0, 49, 5) ................................................................ [entry]
utssys(0x9fffffffbf7df4f0, 49, 5) ................................................................ = 0
arg: "Machine1"
socket(AF_UNIX, SOCK_STREAM, 0) .................................................................. [entry]
socket(AF_UNIX, SOCK_STREAM, 0) .................................................................. = 11
connect(11, 0x9fffffffffffd400, 94) .............................................................. [entry]
sin_family: AF_UNIX
sun_path: /tmp/SocketStream.9008
connect(11, 0x9fffffffffffd400, 94) .............................................................. ERR#239 ECONNREFUSED
sin_family: AF_UNIX
sun_path: /tmp/SocketStream.9008
close(11) ........................................................................................ [entry]
close(11) ........................................................................................ = 0
gettimeofday(0x9fffffffffffd1b0, NULL) ........................................................... [entry]
gettimeofday(0x9fffffffffffd1b0, NULL) ........................................................... = 0
open(0xc00000000025b560, O_RDONLY, 045000) ....................................................... [entry]
open("/etc/default/tz", O_RDONLY|0x800, 045000) .................................................. = 11
fstat(11, 0x9fffffffffffce50) .................................................................... [entry]
fstat(11, 0x9fffffffffffce50) .................................................................... = 0

Thanks

Jerome