ioctl errors when using stunnel (problem & solution!)

12 views
Skip to first unread message

cgarvey

unread,
Jul 3, 2009, 10:45:23 AM7/3/09
to nzbperl
Hi,

I've been using this script successfully for years (cheers to the
author!). On a recent Ubuntu 9.04 install, it all went pear shaped, so
I thought I'd share the experience in case anyone Googles it later.

I've been using stunnel to use SSL connections that my provider
supports, because of the problems with SSL connections hanging, in
nzbperl, as documented in other threads.

On Ubuntu 9.04, I cranked up the same stunnel script/config I'd been
using, but nzbperl wouldn't connect successfully. The error being
reported was "Inappropriate ioctl for device".

After lots of hair pulling, the issue turned out to be the use of
"localhost" alias. My stunnel script/config binds to port 2222 on
localhost (and the nzbperlrc then references localhost:2222). All
seemed good (I could even telnet localhost 2222 and verify)! However,
nzbperl still could not connect. It turned out to be the /etc/hosts
file! In the default 9.04 install there is a "localhost" alias for
*both* the ipv4 127.0.0.1 interface an the ipv6 ::1 interface! So
while command line telnet was picking up on the ipv4 lo0 interface,
nzbperl wasn't (which I assume isn't its fault!).

To solve the error, remove the ipv6 "localhost" (there are still other
aliases, by default, like "ip6-localhost"), or bind your stunnel to
127.0.0.1 explicitly (and update your nzbperlrc accordingly).

Just another potential solution to the not very helpful "Inappropriate
ioctl for device" problem.

Thanks again to the author for the useful script!

Reply all
Reply to author
Forward
0 new messages