Red Hat Bugzilla – Bug 862286
If portmapper is killed it cannot be restarted, responds with: "cannot bind udp: Address already in use"
Last modified: 2013-05-01 04:37:56 EDT
Created attachment 620313 [details]
Set socket option SO_REUSEADDR
Description of problem:
When another machine or device queries port 111 portmapper is killed, upon restarting it responds with the error:
cannot bind udp: Address already in use
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1) on terminal A: service portmap start
2) on terminal B: telnet localhost 111
3) on terminal A: service portmap restart
- portmap gets killed
- telnet session gets closed
- portmap can not be restarted: "cannot bind udp: Address already in use"
portmap restarts properly
- Trying to start portmap manually fails as well.
- netstat does not show any port 111 in use.
If you wait to issue the portmap start it will eventually start due to a timeout
# netstat -np | grep 111
tcp 0 0 127.0.0.1:111 127.0.0.1:50306 TIME_WAIT -
tcp 0 0 192.168.130.11:56334 192.168.130.11:111 TIME_WAIT -
Note that the error message mentions UDP, telnet uses TCP. This is actually a copy/paste error in the portmap sources. On an error while binding the TCP-socket, the message mentions UDP wrongly.
Attached patch sets the socket option SO_REUSEADDR (man 7 socket). This should allow portmap to bind to the address that is kept in-use by the TIME_WAIT.
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
There are currently no customers interested in seeing this fixed in RHEL-5. If you are in need of this problem to be solved, please open a support case to inform Red Hat Global Support Services: