1834456 Members
2297 Online
110067 Solutions
New Discussion

How to free a port?

 
Mike_354
Advisor

How to free a port?

I need to restart web server, but it gave the following error: "(226)Address already in use: make_sock: could not bind to address 0.0.0.0:443 no listening sockets available, shutting down"

lsof -i:443 gives
rng 1622 root 5u inet 0x5eb1cc80 0t0 TCP *:443 (LISTEN)
ps for rng process:
root 1622 0 0 Dec 10 ttyp1 0:00 rng

I can not kill that process nor can I reconfigure that module through kmadmin: "kmadmin: rng: Device busy". Beside reboot, is there any other ways?

18 REPLIES 18
Jeff Schussele
Honored Contributor

Re: How to free a port?

Hi Mike,

Was it still listening on port 80?

If not it sounds like your web server is misconfigured i.e. it's not stopping https - the secure html port.
Are you running Apache Secure?

rng sounds like Random Number Generator - but I'm not sure why it would be listening on 443.

Are you running the kcweb product - the new web-based kernel admin product? If so you may need to stop it as well. But I think that runs on neither 80 nor 443 - but not positive.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mike_354
Advisor

Re: How to free a port?

Thanks for the reply.
Yes, I am running Apache Secure. It is running on both 80 and 443.

And no, I am not runnging kcweb product.

Regards,

Mike
Mike_354
Advisor

Re: How to free a port?

Yes, it is still listening on port 80 as well.
rng 1622 root 3u inet 0x5e8ac340 0t0 TCP web:http (LISTEN)

Regards,

Mike
Jeff Schussele
Honored Contributor

Re: How to free a port?

Hi (again) Mike,

Are you running:

/sbin/init.d/apache stop
then
/sbin/init.d/apache start

If not - how are you trying to restart the web server?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mike_354
Advisor

Re: How to free a port?

Hi Jeff,

I am not starting apache under /sbin/init.d but similar to it under different directory. I used stop_httpd and start_httpd_secure.

Regards,

Mike
Jeff Schussele
Honored Contributor

Re: How to free a port?

Hi,

If you have that script in /sbin/init.d I suggest you try it because it will stop Tomcat & the Web Admin products as well as vanilla Apache. Those may still be running & that's what may be still listening on those ports.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mike_354
Advisor

Re: How to free a port?

Hi Jeff,

yes, I have stopped all of the web applications. But the ports are still in the LISTEN mode.

Regards,

Mike
Jeff Schussele
Honored Contributor

Re: How to free a port?

OK - check /etc/inittab for a command that respawns - specifically that rng process.
If it's there then comment it out & kill it. If a standard kill fails try several other signals before resorting to the -9
Something has to be starting it & possibly respawning it when you stop Apache.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mike_354
Advisor

Re: How to free a port?

Hi,

There is no such line in inittab file. And I have try all the kill signal(including -9), it still did not kill the rng process.

Regards,

Mike
Jeff Schussele
Honored Contributor

Re: How to free a port?

OK - If kill -9 doesn't kill it then it's either blocked on I/O or the PID is in kernel mode i.e. 128 > priority < 153

What does ps -efl show the priority of that PID to be?
What's the PID's parent PID (PPID) - can you kill that - DON'T if it's 1.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mike_354
Advisor

Re: How to free a port?

its priority is 153 and its PPID is 0.

Regards,

Mike
Jeff Schussele
Honored Contributor

Re: How to free a port?

I should have said <= and >= .
So that's why you can't kill it - it's not signalable. Signalable would be less than 128 & greater than 154.
So it's probably sleeping and I'm not sure what you can do to stop it short of a reboot.
Your best bet is to find what's starting rng & stop it. But I think it's kmadmin that has.
What does
kmadmin -S
return?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mike_354
Advisor

Re: How to free a port?

Hi,

rng process was started after the Apache Secure start.

Here is the kmadmin -S:

Module Name rng
Module ID 2
Module Path /stand/dlkm/mod.d/rng
Status LOADED
Size 57344
Base Address 0x11b2000
BSS Size 0
BSS Base Address 0x0
Hold Count 1
Dependent Count 0
Unload Delay 0 seconds
Description rng - random number generator for the /dev/[u]random interface
Type WSIO
Block Major -1
Character Major 78
Flags b5

Regards,

Mike

Jeff Schussele
Honored Contributor

Re: How to free a port?

Looking over your earlier posts - I don't see

stop_httpd_secure

Have you run this command yet?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sridhar Bhaskarla
Honored Contributor

Re: How to free a port?

Hi,

I wonder if it is rng that listens at this port. I have checked up my workstation and it is not listening at this port.

Looks like it is your apache web server. To stop ssl part of apache, you would need to issue

apachectl -stop

I believe /sbin/init.d/apache does the same thing ofcourse. Make sure you don't have any httpd's running with -DSSL arguments.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Mike_354
Advisor

Re: How to free a port?

Hi,

Yes, I did run stop_httpd_secure, which is also apachectl -stop.

Regards,

Mike
JJ Urich
Frequent Advisor

Re: How to free a port?

I just had the same problem with rng and it listening on all of my named ports. This appears to be a major bug as this rng process as you've experienced is un-killable. Our only solution was a reboot. I'm opening a call w/ HP to see if there is a patch for this problem. I talked to another sys admin here at the university and they've experienced the same problem. Any one out there have fix for this or run into this???

Below is the lsof on the unkillable rng process:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rng 738 root cwd DIR 64,0x3 8192 12490 / (/dev/vg00/lvol3)
rng 738 root 0u CHR 3,0x2 0t0 65 /dev/null
rng 738 root 1u CHR 3,0x2 0t0 65 /dev/null
rng 738 root 2u CHR 3,0x2 0t0 65 /dev/null
rng 738 root 3u FIFO 0x5c3df1c8 0t0 1831
rng 738 root 4u FIFO 0x5c3df4c8 0t0 305
rng 738 root 5w FIFO 0x5c3df4c8 0t0 305
rng 738 root 20u inet 0x5c64c1c0 0t0 UDP fileserv.divms.uiowa.edu:domain (Idle)
rng 738 root 21u inet 0x5c64c340 0t0 TCP fileserv.divms.uiowa.edu:domain (LISTEN)
rng 738 root 22u inet 0x5c64c4c0 0t0 UDP pcnfsnew.divms.uiowa.edu:domain (Idle)
rng 738 root 23u inet 0x5c64c640 0t0 TCP pcnfsnew.divms.uiowa.edu:domain (LISTEN)
rng 738 root 24u inet 0x5c64c7c0 0t0 UDP mail.divms.uiowa.edu:domain (Idle)
rng 738 root 25u inet 0x5c64c940 0t0 TCP mail.divms.uiowa.edu:domain (LISTEN)
rng 738 root 26u inet 0x5c64cac0 0t0 UDP serv01.divms.uiowa.edu:domain (Idle)
rng 738 root 27u inet 0x5c64cc40 0t0 TCP serv01.divms.uiowa.edu:domain (LISTEN)
rng 738 root 28u inet 0x5c64cdc0 0t0 UDP localhost:domain (Idle)
rng 738 root 29u inet 0x69844080 0t0 TCP localhost:domain (LISTEN)
rng 738 root 30u inet 0x69844200 0t0 UDP mserv01.divms.uiowa.edu:domain (Idle)
rng 738 root 31u inet 0x69844380 0t0 TCP mserv01.divms.uiowa.edu:domain (LISTEN)
rng 738 root 32u inet 0x5c64c040 0t0 UDP *:49152 (Idle)
rng 738 root 33u inet 0x69844500 0t0 TCP localhost:953 (LISTEN)

JJ
I used to have spare time, then I had kids.
JJ Urich
Frequent Advisor

Re: How to free a port?

Opened a call on this issues and it is indeed a bug for the 06 version of the kernel random # generator. It is fixed in the 09 release. Here is the revision history:

Revision history

The version B.11.11.07 eliminates the dependency on the /etc/loadmods file. If this file does not exist or does not have the entry for KRNG11i, the /dev/random and /dev/urandom device files are removed at system reboot time to prevent unexpected side effects caused by accessing these device special files.

The version B.11.11.08 fixes the problem that the KRNG entoropy daemon process inherits the open file descriptors and current working directory from the calling process.

The version B.11.11.09 fixes the problem that the KRNG entoropy daemon process inherits the processor binding, process scheduling policy and priority from the calling process.

So, if you run into this problem, before you reboot your machine, install the 11.11.09 release and save yourself another reboot.

JJ
I used to have spare time, then I had kids.