[Solved] Rsh does not close connection on exit

Dear all,

We have a service that we start up remotely with rsh but unfortunately, the rsh never returns to the calling server. This seems to be because the processes of the service we've just started hold the port open.

RBATTE1 @ /home/RBATTE1>netstat -na|grep 49.51
tcp4       0      0  111.222.333.444.514       111.222.333.555.1022      CLOSE_WAIT
tcp        0      0  111.222.333.444.1023      111.222.333.555.1021      FIN_WAIT_2
tcp4       0      0  111.222.333.444.50465     111.222.333.555.2049      ESTABLISHED

RBATTE1 @ /home/RBATTE1>sudo lsof -i tcp:514
COMMAND    PID USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
inetd    32516 root    6u  IPv6 0x71967de4      0t0  TCP *:shell (LISTEN)
dsrvcmd  75188 root    0u  IPv6 0x726cede4    0t125  TCP myserver.mydomain:shell->caller.mydomain:1022 (CLOSE_WAIT)

RBATTE1 @ /home/RBATTE1>

When run locally on the command line, all is well with the simple script and I can log off the session without issue or other prompt. When called with rsh, the script called does complete (we have logging to show that), so I'm wondering how I can disinherit/detach the service processes started up.

Server where script will run is AIX 5.1 :o and the server calling is RHEL 6.3

Suggestions would be most welcome. Many thanks, in advance,
Robin
Liverpool/Blackburn
UK

---------- Post updated at 11:59 AM ---------- Previous update was at 11:21 AM ----------

Cancel that. I managed it with a nohup xxxxx & call to start the service inside the script.

All working, and I feel pretty daft :o

Robin :stuck_out_tongue:

Thanks for telling us :cool: