On Tue, Feb 19, 2019 at 10:43 AM <rlwestl...@gmail.com> wrote: > It definitely only happens after opening a connection to an external > server. And if I run tcpdrop on the connections before shutting the jail > down, it works every time. Though the connection to my browser (the program > hosts a web application) doesn't cause a problem, which makes me think it's > only connections where the in-jail application is the client. Also, I tried > using a short Python script that just opened a tcp connection to another > server and tried to shutdown the jail. It waited for a while (which it > didn't in the Go case), but still failed with "device busy". > > I did manage to put together a script using tcpdrop that could pick out > only the right connections to drop, but my code reviewer doesn't like the > solution; he wants to solve the problem from within Go rather than hack our > way around it. > > I have also tried manually killing the process before shutting down the > jail. Regardless of SIGTERM or SIGKILL, the program exits immediately and > the connections are left in TIME_WAIT. >
The TIME_WAIT state is normal and expected. You've shown that the problem has nothing to do with Go's behavior. Taking your statements at face value a reasonable conclusion is that you can't shutdown a FreeBSD jail when it contains open TCP connections. Which is surprising. I googled "freebsd jail device busy tcp" and the first result was https://forums.freebsd.org/threads/cannot-cleanly-stop-jails-after-using-graphical-applications.56778/ which describes the scenario you're observing and does not involve a program written in Go. I think you need to talk to the FreeBSD support community. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.