Re: sockets stuck in use

2010-07-20 Thread Jim
On Mon, Jul 19, 2010 at 11:04 PM, Adam Vande More amvandem...@gmail.com wrote:
 On Mon, Jul 19, 2010 at 3:12 AM, Jim stapleton...@gmail.com wrote:

 I was working on an application I've been developing, and I closed the
 last instance a bit over 12 hours ago, but some of the sockets are
 still stuck in use:
 [s...@elrond ~/dev/pipe/scripts]$ netstat | grep -e 'tcp' | grep 9612
 tcp4       0      0 192.168.1.80.42464     192.168.1.2.9612       SYN_SENT
 tcp4       0      0 192.168.1.80.35742     192.168.1.2.9612       CLOSED
 tcp4       0      0 192.168.1.80.46116     192.168.1.2.9612       CLOSED
 tcp4       0      0 192.168.1.80.36792     192.168.1.2.9612       CLOSED


 Is there any way to get rid of them without restarting the machine? I
 was playing with sockopt SO_KEEPALIVE and SO_LINGER when I caused this
 issue..

 sockstat(1) will tell you process that has the socket open, can you kill it
 from there?

 --
 Adam Vande More



Thanks... That told me who to kill
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


sockets stuck in use

2010-07-19 Thread Jim
I was working on an application I've been developing, and I closed the
last instance a bit over 12 hours ago, but some of the sockets are
still stuck in use:
[s...@elrond ~/dev/pipe/scripts]$ netstat | grep -e 'tcp' | grep 9612
tcp4   0  0 192.168.1.80.42464 192.168.1.2.9612   SYN_SENT
tcp4   0  0 192.168.1.80.35742 192.168.1.2.9612   CLOSED
tcp4   0  0 192.168.1.80.46116 192.168.1.2.9612   CLOSED
tcp4   0  0 192.168.1.80.36792 192.168.1.2.9612   CLOSED


Is there any way to get rid of them without restarting the machine? I
was playing with sockopt SO_KEEPALIVE and SO_LINGER when I caused this
issue..

Thanks,
-Jim Stapleton
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: sockets stuck in use

2010-07-19 Thread Anonymous
Jim stapleton...@gmail.com writes:

 I was working on an application I've been developing, and I closed the
 last instance a bit over 12 hours ago, but some of the sockets are
 still stuck in use:
 [s...@elrond ~/dev/pipe/scripts]$ netstat | grep -e 'tcp' | grep 9612
 tcp4   0  0 192.168.1.80.42464 192.168.1.2.9612   SYN_SENT
 tcp4   0  0 192.168.1.80.35742 192.168.1.2.9612   CLOSED
 tcp4   0  0 192.168.1.80.46116 192.168.1.2.9612   CLOSED
 tcp4   0  0 192.168.1.80.36792 192.168.1.2.9612   CLOSED


 Is there any way to get rid of them without restarting the machine? I
 was playing with sockopt SO_KEEPALIVE and SO_LINGER when I caused this
 issue..

Does tcpdrop(8) help?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: sockets stuck in use

2010-07-19 Thread Jim
On Mon, Jul 19, 2010 at 10:20 AM, Anonymous swel...@gmail.com wrote:
 Jim stapleton...@gmail.com writes:

 I was working on an application I've been developing, and I closed the
 last instance a bit over 12 hours ago, but some of the sockets are
 still stuck in use:
 [s...@elrond ~/dev/pipe/scripts]$ netstat | grep -e 'tcp' | grep 9612
 tcp4       0      0 192.168.1.80.42464     192.168.1.2.9612       SYN_SENT
 tcp4       0      0 192.168.1.80.35742     192.168.1.2.9612       CLOSED
 tcp4       0      0 192.168.1.80.46116     192.168.1.2.9612       CLOSED
 tcp4       0      0 192.168.1.80.36792     192.168.1.2.9612       CLOSED


 Is there any way to get rid of them without restarting the machine? I
 was playing with sockopt SO_KEEPALIVE and SO_LINGER when I caused this
 issue..

 Does tcpdrop(8) help?


No, the result (The first command is what I figured would be correct,
given the man page, the second was just to be paranoid - although this
machine is both the host and destination, having glommed onto several
ports. The .80 IPs are within the web server's jail. I cannot tcpdrop
within the jail

[s...@elrond ~/dev/pipe/scripts]$ netstat | grep -e 'tcp' | grep 9612
tcp4   0  0 192.168.1.80.42464 192.168.1.2.9612   SYN_SENT
tcp4   0  0 192.168.1.80.35742 192.168.1.2.9612   CLOSED
tcp4   0  0 192.168.1.80.46116 192.168.1.2.9612   CLOSED
tcp4   0  0 192.168.1.80.36792 192.168.1.2.9612   CLOSED
[s...@elrond ~/dev/pipe/scripts]$ sudo tcpdrop 192.168.1.80 46116
192.168.1.2 9612
tcpdrop: 192.168.1.80 46116 192.168.1.2 9612: No such process
[s...@elrond ~/dev/pipe/scripts]$ sudo tcpdrop 192.168.1.2 9612
192.168.1.80 46116
tcpdrop: 192.168.1.2 9612 192.168.1.80 46116: No such process
[s...@elrond ~/dev/pipe/scripts]$ netstat | grep -e 'tcp' | grep 9612
tcp4   0  0 192.168.1.80.42464 192.168.1.2.9612   SYN_SENT
tcp4   0  0 192.168.1.80.35742 192.168.1.2.9612   CLOSED
tcp4   0  0 192.168.1.80.46116 192.168.1.2.9612   CLOSED
tcp4   0  0 192.168.1.80.36792 192.168.1.2.9612   CLOSED


[s...@elrond ~/dev/pipe/scripts]$ cd /data/jail/
[s...@elrond /data/jail]$ sudo ./bilbo_web_shell
[r...@bilbo_web /data/jail]# tcpdrop 192.168.1.80 46116 192.168.1.2 9612
tcpdrop: 192.168.1.80 46116 192.168.1.2 9612: Operation not permitted


Thanks,
-Jim Stapleton
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: sockets stuck in use

2010-07-19 Thread Adam Vande More
On Mon, Jul 19, 2010 at 3:12 AM, Jim stapleton...@gmail.com wrote:

 I was working on an application I've been developing, and I closed the
 last instance a bit over 12 hours ago, but some of the sockets are
 still stuck in use:
 [s...@elrond ~/dev/pipe/scripts]$ netstat | grep -e 'tcp' | grep 9612
 tcp4   0  0 192.168.1.80.42464 192.168.1.2.9612   SYN_SENT
 tcp4   0  0 192.168.1.80.35742 192.168.1.2.9612   CLOSED
 tcp4   0  0 192.168.1.80.46116 192.168.1.2.9612   CLOSED
 tcp4   0  0 192.168.1.80.36792 192.168.1.2.9612   CLOSED


 Is there any way to get rid of them without restarting the machine? I
 was playing with sockopt SO_KEEPALIVE and SO_LINGER when I caused this
 issue..


sockstat(1) will tell you process that has the socket open, can you kill it
from there?

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org