Bug#612963: apt-cacher no more opens an IPv4 tcp socket
Mark Hindley writes: > On Sun, Feb 13, 2011 at 11:14:34AM +0100, Leopold BAILLY wrote: >> Leopold BAILLY writes: >> >> That's it : this sysctl config file with net.ipv6.bindv6only = 1 is >> the reason why apt-cacher isn't listening to IPv4 anymore. > > Good > >> >> I can't find any official Debian package providing this file with >> http://packages.debian.org/search?searchon=contents&keywords=bindv6only.conf&mode=exactfilename&suite=testing&arch=any, >> so I think everything is ok and I can safely remove this file. > > I have traced this to bug number #560238 (netbase). It is worth reading if you > want all the background. Well done. >> By the way, I notice on my host that half of the daemons are listening >> to both IPv4 *and* IPv6 ; I don't know if there is any best practice >> about doing this or not. > > They upshot of that is that apt-cacher seems to be fine only listening > on 1 socket and mapping IPv4 to IPv6 addresses > > I plan to close this report, if you are happy Yes, definitely. Many thanks. -- Léo. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
On Sun, Feb 13, 2011 at 11:14:34AM +0100, Leopold BAILLY wrote: > Leopold BAILLY writes: > > That's it : this sysctl config file with net.ipv6.bindv6only = 1 is > the reason why apt-cacher isn't listening to IPv4 anymore. Good > > I can't find any official Debian package providing this file with > http://packages.debian.org/search?searchon=contents&keywords=bindv6only.conf&mode=exactfilename&suite=testing&arch=any, > so I think everything is ok and I can safely remove this file. I have traced this to bug number #560238 (netbase). It is worth reading if you want all the background. > By the way, I notice on my host that half of the daemons are listening > to both IPv4 *and* IPv6 ; I don't know if there is any best practice > about doing this or not. They upshot of that is that apt-cacher seems to be fine only listening on 1 socket and mapping IPv4 to IPv6 addresses I plan to close this report, if you are happy Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
Leopold BAILLY writes: > Mark Hindley writes: > >> On Sat, Feb 12, 2011 at 11:43:16AM +0100, Leopold BAILLY wrote: >>> The issue is that apt-cacher is listening for IPv6 only. Have a look >>> at how other daemons, for example ssh, are listening to : >>> >>> leo@stellie:~$ netstat -na | grep :22 >>> tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN >>> >>> tcp6 0 0 :::22 :::*LISTEN >>> >>> >>> You can see that ssh is listening for both IPv4 and IPv6 incoming >>> connections. So maybe, the bug is there : you don't have to choose >>> between IPv6 and IPv4, but you have to do both, if possible. >> >> Maybe. The reason why I am a bit hesitant is that I have a system here >> on which the apt-cacher deamon is only listening on tcp6, but I can >> still connect to it using IPv4. I really want to understand why that >> mapping is not happening on your system. >> >> What kernel do you have? Is it one you have compiled or a stock one? Is >> the ipv6 module loaded. If not and you load it, does it make any >> difference? > > OK, I just discovered this file : > > leo@stellie:~$ cat /etc/sysctl.d/bindv6only.conf > # This sysctl sets the default value of the IPV6_V6ONLY socket option. > # > # When disabled, IPv6 sockets will also be able to send and receive IPv4 > # traffic with addresses in the form :::192.0.2.1 and daemons listening > # on IPv6 sockets will also accept IPv4 connections. > # > # When IPV6_V6ONLY is enabled, daemons interested in both IPv4 and IPv6 > # connections must open two listening sockets. > # This is the default behaviour of almost all modern operating systems. > > net.ipv6.bindv6only = 1 > > > dpkg -S cannot find any package it belongs to ; this must be a removed > package. > > I guess that removing this file or setting a value of 0 will fix the > issue, but it would be great to find which package brought this file > whith this default setting. > > I comment the line and I will give it a try after reboot. That's it : this sysctl config file with net.ipv6.bindv6only = 1 is the reason why apt-cacher isn't listening to IPv4 anymore. I can't find any official Debian package providing this file with http://packages.debian.org/search?searchon=contents&keywords=bindv6only.conf&mode=exactfilename&suite=testing&arch=any, so I think everything is ok and I can safely remove this file. By the way, I notice on my host that half of the daemons are listening to both IPv4 *and* IPv6 ; I don't know if there is any best practice about doing this or not. leo@stellie:~$ for d in $(sudo netstat -nap | grep tcp6 | awk '{print $7}'); do sudo netstat -nap |grep $d |grep 'LISTEN ' ;done |sort -k7 tcp0 0 0.0.0.0:389 0.0.0.0:* LISTEN 1939/slapd tcp6 0 0 :::389 :::*LISTEN 1939/slapd tcp0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1999/dnsmasq tcp6 0 0 :::53 :::*LISTEN 1999/dnsmasq tcp0 0 0.0.0.0:464 0.0.0.0:* LISTEN 2047/kadmind tcp0 0 0.0.0.0:749 0.0.0.0:* LISTEN 2047/kadmind tcp6 0 0 :::464 :::*LISTEN 2047/kadmind tcp6 0 0 :::80 :::*LISTEN 2191/apache2 tcp0 0 0.0.0.0:631 0.0.0.0:* LISTEN 2277/cupsd tcp6 0 0 :::631 :::*LISTEN 2277/cupsd tcp6 0 0 :::139 :::*LISTEN 2459/smbd tcp6 0 0 :::139 :::*LISTEN 2459/smbd tcp6 0 0 :::445 :::*LISTEN 2459/smbd tcp6 0 0 :::445 :::*LISTEN 2459/smbd tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2532/sshd tcp6 0 0 :::22 :::*LISTEN 2532/sshd tcp6 0 0 :::3142 :::*LISTEN 4012/perl Thanks a lot for your support, Mark. -- Léo. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
Mark Hindley writes: > On Sat, Feb 12, 2011 at 11:43:16AM +0100, Leopold BAILLY wrote: >> The issue is that apt-cacher is listening for IPv6 only. Have a look >> at how other daemons, for example ssh, are listening to : >> >> leo@stellie:~$ netstat -na | grep :22 >> tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN >> >> tcp6 0 0 :::22 :::*LISTEN >> >> >> You can see that ssh is listening for both IPv4 and IPv6 incoming >> connections. So maybe, the bug is there : you don't have to choose >> between IPv6 and IPv4, but you have to do both, if possible. > > Maybe. The reason why I am a bit hesitant is that I have a system here > on which the apt-cacher deamon is only listening on tcp6, but I can > still connect to it using IPv4. I really want to understand why that > mapping is not happening on your system. > > What kernel do you have? Is it one you have compiled or a stock one? Is > the ipv6 module loaded. If not and you load it, does it make any > difference? OK, I just discovered this file : leo@stellie:~$ cat /etc/sysctl.d/bindv6only.conf # This sysctl sets the default value of the IPV6_V6ONLY socket option. # # When disabled, IPv6 sockets will also be able to send and receive IPv4 # traffic with addresses in the form :::192.0.2.1 and daemons listening # on IPv6 sockets will also accept IPv4 connections. # # When IPV6_V6ONLY is enabled, daemons interested in both IPv4 and IPv6 # connections must open two listening sockets. # This is the default behaviour of almost all modern operating systems. net.ipv6.bindv6only = 1 dpkg -S cannot find any package it belongs to ; this must be a removed package. I guess that removing this file or setting a value of 0 will fix the issue, but it would be great to find which package brought this file whith this default setting. I comment the line and I will give it a try after reboot. -- Léo. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
On Sat, Feb 12, 2011 at 11:43:16AM +0100, Leopold BAILLY wrote: > The issue is that apt-cacher is listening for IPv6 only. Have a look > at how other daemons, for example ssh, are listening to : > > leo@stellie:~$ netstat -na | grep :22 > tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN > > tcp6 0 0 :::22 :::*LISTEN > > > You can see that ssh is listening for both IPv4 and IPv6 incoming > connections. So maybe, the bug is there : you don't have to choose > between IPv6 and IPv4, but you have to do both, if possible. Maybe. The reason why I am a bit hesitant is that I have a system here on which the apt-cacher deamon is only listening on tcp6, but I can still connect to it using IPv4. I really want to understand why that mapping is not happening on your system. What kernel do you have? Is it one you have compiled or a stock one? Is the ipv6 module loaded. If not and you load it, does it make any difference? Thanks Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
Mark Hindley writes: > On Sat, Feb 12, 2011 at 12:02:19AM +0100, Leopold BAILLY wrote: >> Mark Hindley writes: >> >> > On Fri, Feb 11, 2011 at 11:09:08PM +0100, Leopold BAILLY wrote: >> >> Package: apt-cacher >> >> Version: 1.6.12 >> >> Severity: normal >> >> >> >> After my latest update, i was no more able to connect to apt-cacher. >> > >> > What was the error message? Are you using deamon mode or inetd mode? Can >> > you post the /etc/apt-cacher/apt-cacher.conf >> >> As I said, I was just unable to connect to the apt-cacher daemon. >> >> leo@stellie:~$ sudo aptitude install libio-socket-inet6-perl >> ... >> leo@stellie:~$ sudo invoke-rc.d apt-cacher restart >> Restarting Apt-Cacher: apt-cacherdebug [8473]: Using IPv6 >> debug [8473]: Listening on :::3142 >> debug [8473]: fork listener >> debug [8473]: Clean up before exiting. >> . >> leo@stellie:~$ netstat -na | grep 3142 >> tcp6 0 0 :::3142 :::*LISTEN >> >> leo@stellie:~$ telnet localhost 3142 >> Trying 127.0.0.1... >> telnet: Unable to connect to remote host: Connection refused > > There is something else going on here. Apt-cacher is running and > listening. Something else is blocking the connection. Are you using TCP > wrappers? Firewall? The issue is that apt-cacher is listening for IPv6 only. Have a look at how other daemons, for example ssh, are listening to : leo@stellie:~$ netstat -na | grep :22 tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp6 0 0 :::22 :::*LISTEN You can see that ssh is listening for both IPv4 and IPv6 incoming connections. So maybe, the bug is there : you don't have to choose between IPv6 and IPv4, but you have to do both, if possible. -- Léo. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
On Fri, Feb 11, 2011 at 11:09:08PM +0100, Leopold BAILLY wrote: > Package: apt-cacher > Version: 1.6.12 > Severity: normal > > After my latest update, i was no more able to connect to apt-cacher. What was the error message? Are you using deamon mode or inetd mode? Can you post the /etc/apt-cacher/apt-cacher.conf > I first found that apt-cacher was no more opening an IPv4 tcp socket, but > only an IPv6 one. > Then i looked into the perl code and found this : > sub io_socket_inet46 { > # Test if IPv6 is available and use if it is > if (eval{local $SIG{__DIE__} = 'IGNORE'; # Prevent log verbosity >require IO::Socket::INET6}){ > import IO::Socket::INET6; > debug_message('Using IPv6'); > return IO::Socket::INET6->new(@_); > } > else { > return IO::Socket::INET->new(@_); > } > } > that means : "if IO::Socket::INET6 is an installed perl module, then i want > to do IPv6 and i don't want to do IPv4 anymore" Yes, that is right. And IPv6 understands IPv4 as well > I don't know why libio-socket-inet6-perl was installed on my host, but I > don't have anything configured for IPv6 in my network, by the way > > So i just removed this package, that i don't care about, and everything goes > right now. > > So what ? I don't know anything about IPv6, but the way it is used by > apt-cacher leads to no more IPv4 connectivity, so there might be something > wrong somewhere. Maybe, but I need some more detailed information as above. Thanks Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
On Sat, Feb 12, 2011 at 12:02:19AM +0100, Leopold BAILLY wrote: > Mark Hindley writes: > > > On Fri, Feb 11, 2011 at 11:09:08PM +0100, Leopold BAILLY wrote: > >> Package: apt-cacher > >> Version: 1.6.12 > >> Severity: normal > >> > >> After my latest update, i was no more able to connect to apt-cacher. > > > > What was the error message? Are you using deamon mode or inetd mode? Can > > you post the /etc/apt-cacher/apt-cacher.conf > > As I said, I was just unable to connect to the apt-cacher daemon. > > leo@stellie:~$ sudo aptitude install libio-socket-inet6-perl > ... > leo@stellie:~$ sudo invoke-rc.d apt-cacher restart > Restarting Apt-Cacher: apt-cacherdebug [8473]: Using IPv6 > debug [8473]: Listening on :::3142 > debug [8473]: fork listener > debug [8473]: Clean up before exiting. > . > leo@stellie:~$ netstat -na | grep 3142 > tcp6 0 0 :::3142 :::*LISTEN > > leo@stellie:~$ telnet localhost 3142 > Trying 127.0.0.1... > telnet: Unable to connect to remote host: Connection refused There is something else going on here. Apt-cacher is running and listening. Something else is blocking the connection. Are you using TCP wrappers? Firewall? Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
Mark Hindley writes: > On Fri, Feb 11, 2011 at 11:09:08PM +0100, Leopold BAILLY wrote: >> Package: apt-cacher >> Version: 1.6.12 >> Severity: normal >> >> After my latest update, i was no more able to connect to apt-cacher. > > What was the error message? Are you using deamon mode or inetd mode? Can > you post the /etc/apt-cacher/apt-cacher.conf As I said, I was just unable to connect to the apt-cacher daemon. leo@stellie:~$ sudo aptitude install libio-socket-inet6-perl ... leo@stellie:~$ sudo invoke-rc.d apt-cacher restart Restarting Apt-Cacher: apt-cacherdebug [8473]: Using IPv6 debug [8473]: Listening on :::3142 debug [8473]: fork listener debug [8473]: Clean up before exiting. . leo@stellie:~$ netstat -na | grep 3142 tcp6 0 0 :::3142 :::*LISTEN leo@stellie:~$ telnet localhost 3142 Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused >> I first found that apt-cacher was no more opening an IPv4 tcp socket, but >> only an IPv6 one. >> Then i looked into the perl code and found this : >> sub io_socket_inet46 { >> # Test if IPv6 is available and use if it is >> if (eval{local $SIG{__DIE__} = 'IGNORE'; # Prevent log verbosity >> require IO::Socket::INET6}){ >> import IO::Socket::INET6; >> debug_message('Using IPv6'); >> return IO::Socket::INET6->new(@_); >> } >> else { >> return IO::Socket::INET->new(@_); >> } >> } >> that means : "if IO::Socket::INET6 is an installed perl module, then i want >> to do IPv6 and i don't want to do IPv4 anymore" > > Yes, that is right. And IPv6 understands IPv4 as well Mmmm, it seems not : leo@stellie:~$ sudo aptitude purge libio-socket-inet6-perl ... leo@stellie:~$ sudo invoke-rc.d apt-cacher restart Restarting Apt-Cacher: apt-cacherdebug [9289]: Listening on 0.0.0.0:3142 debug [9289]: fork listener debug [9289]: Clean up before exiting. . leo@stellie:~$ netstat -na | grep 3142 tcp0 0 0.0.0.0:31420.0.0.0:* LISTEN leo@stellie:~$ telnet localhost 3142 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. >> I don't know why libio-socket-inet6-perl was installed on my host, but I >> don't have anything configured for IPv6 in my network, by the way >> >> So i just removed this package, that i don't care about, and everything goes >> right now. >> >> So what ? I don't know anything about IPv6, but the way it is used by >> apt-cacher leads to no more IPv4 connectivity, so there might be something >> wrong somewhere. > > Maybe, but I need some more detailed information as above. I think you have all you need now. Many thanks for looking at this. -- Léo. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#612963: apt-cacher no more opens an IPv4 tcp socket
Package: apt-cacher Version: 1.6.12 Severity: normal After my latest update, i was no more able to connect to apt-cacher. I first found that apt-cacher was no more opening an IPv4 tcp socket, but only an IPv6 one. Then i looked into the perl code and found this : sub io_socket_inet46 { # Test if IPv6 is available and use if it is if (eval{local $SIG{__DIE__} = 'IGNORE'; # Prevent log verbosity require IO::Socket::INET6}){ import IO::Socket::INET6; debug_message('Using IPv6'); return IO::Socket::INET6->new(@_); } else { return IO::Socket::INET->new(@_); } } that means : "if IO::Socket::INET6 is an installed perl module, then i want to do IPv6 and i don't want to do IPv4 anymore" I don't know why libio-socket-inet6-perl was installed on my host, but I don't have anything configured for IPv6 in my network, by the way So i just removed this package, that i don't care about, and everything goes right now. So what ? I don't know anything about IPv6, but the way it is used by apt-cacher leads to no more IPv4 connectivity, so there might be something wrong somewhere. Hope this helps. Léopold. -- System Information: Debian Release: 6.0 APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core) Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15) Shell: /bin/sh linked to /bin/dash Versions of packages apt-cacher depends on: ii ed1.4-3 The classic UNIX line editor ii libdigest-sha1-perl 2.13-1 NIST SHA-1 message digest algorith ii libfilesys-diskspace-perl 0.05-13fetch filesystem size and usage in ii libfreezethaw-perl0.5001-1 module to serialize and deserializ pn libio-compress-bzip2-perl (no description available) ii libio-compress-perl [libio-co 2.024-1bundle of IO::Compress modules ii libio-compress-zlib-perl 2.024-1Transitional dummy package for IO: ii libio-interface-perl 1.05-1 socket methods to get/set interfac ii libwww-curl-perl 4.12-1 Perl bindings to libcurl ii libwww-perl 5.836-1Perl HTTP/WWW client/server librar ii perl [libio-compress-zlib-per 5.10.1-17 Larry Wall's Practical Extraction Versions of packages apt-cacher recommends: ii libberkeleydb-perl 0.42-1~squeeze1 use Berkeley DB 4 databases from P Versions of packages apt-cacher suggests: pn libio-socket-inet6-perl(no description available) -- Configuration Files: /etc/apt-cacher/apt-cacher.conf changed: cache_dir=/var/cache/apt-cacher admin_email=root@localhost daemon_port=3142 group=www-data user=www-data allowed_hosts=* denied_hosts= denied_hosts_6= generate_reports=1 clean_cache=1 offline_mode=0 logdir=/var/log/apt-cacher expire_hours=0 use_proxy=0 use_proxy_auth=0 limit=0 debug=1 path_map = debian ftp.fr.debian.org/debian ftp.de.debian.org/debian; security security.debian.org ; ubuntu archive.ubuntu.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; marillat www.debian-multimedia.org ; xawdecode xawdecode.sourceforge.net/debian ; wto depot.tuxgasy.fr /etc/default/apt-cacher changed: AUTOSTART=1 -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org