Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-09-02 Thread Jonathan Nieder
Olaf van der Spek wrote:

 Lighttpd actually sets v6only = 1 itself (AFAIK) now.

Hmm, right (r2758: bind to IPV6-only if ipv6 address was specified).

 Could you try with a clean conf and post a strace of the error?

 $ ltrace lighttpd -f /etc/lighttpd/lighttpd.conf
...
 memcpy(0x081319b0, :80, 3) = 0x081319b0
 strrchr(:80, ':')  = :80
 strtol(0x81319b1, 0, 10, 0xb7584ff4, 0xb75863a0) = 80
 socket(2, 1, 6)  = 4
 fcntl(4, 2, 1, 0xb7584ff4, 0xb75863a0)   = 0
 setsockopt(4, 1, 2, 0xbfa119fc, 4)   = 0
 bind(4, 0x81318c8, 16, 0xbfa119fc, 4)= -1
...

So: use_ipv6 is not 1 because host_token has no [::] for some reason.

Extract from strace follows.

 # dpkg --purge lighttpd
 # dpkg --install /var/cache/apt/archives/lighttpd_1.4.28-1_i386.deb
...
 Errors were encountered while processing:
  lighttpd
 # strace -f /var/lib/dpkg/info/lighttpd.postinst configure
...
 socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 3
 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbf84d648) = -1 EINVAL (Invalid 
argument)
 _llseek(3, 0, 0xbf84d690, SEEK_CUR) = -1 ESPIPE (Illegal seek)
 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbf84d648) = -1 EINVAL (Invalid 
argument)
 _llseek(3, 0, 0xbf84d690, SEEK_CUR) = -1 ESPIPE (Illegal seek)
 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
 close(3)= 0
 write(1, $SERVER[\socket\] == \[::]:80\ {..., 35) = 35
...
 munmap(0xb725d000, 89487)   = 0
 open(/etc/passwd, O_RDONLY|O_CLOEXEC) = 4
 fcntl64(4, F_GETFD) = 0x1 (flags FD_CLOEXEC)
 _llseek(4, 0, [0], SEEK_CUR) = 0
 fstat64(4, {st_mode=S_IFREG|0644, st_size=1199, ...}) = 0
 mmap2(NULL, 1199, PROT_READ, MAP_SHARED, 4, 0) = 0xb7719000
 _llseek(4, 1199, [1199], SEEK_SET) = 0
 munmap(0xb7719000, 1199)= 0
 close(4)= 0
 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
 connect(4, {sa_family=AF_FILE, path=/var/run/nscd/socket}, 110) = -1 ENOENT 
(No such file or directory)
 close(4)= 0
 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
 connect(4, {sa_family=AF_FILE, path=/var/run/nscd/socket}, 110) = -1 ENOENT 
(No such file or directory)
 close(4)= 0
 open(/etc/group, O_RDONLY|O_CLOEXEC) = 4
 _llseek(4, 0, [0], SEEK_CUR) = 0
 fstat64(4, {st_mode=S_IFREG|0644, st_size=702, ...}) = 0
 mmap2(NULL, 702, PROT_READ, MAP_SHARED, 4, 0) = 0xb7719000
 _llseek(4, 702, [702], SEEK_SET) = 0
 munmap(0xb7719000, 702) = 0
 close(4)= 0
 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
 setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
 bind(4, {sa_family=AF_INET, sin_port=htons(80), 
sin_addr=inet_addr(0.0.0.0)}, 16) = -1 EADDRINUSE (Address already in use)
...



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-09-02 Thread Jonathan Nieder
notfound 564556 lighttpd/1.4.25-2
fixed 564556 lighttpd/1.4.25-2
close 564556
quit

Olaf van der Spek wrote:

 Eh, netstat -nlp | grep 80?

Sigh.  Sorry to waste your time.

# killall apache2
# dpkg --configure -a
Setting up lighttpd (1.4.28-1) ...
Starting web server: lighttpd.
# echo $?
0

I had uninstalled but not purged apache and clearly I do not know
how to use netstat. :(



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-09-02 Thread Jonathan Nieder
Olaf van der Spek wrote:

 Eh, netstat -nlp | grep 80?

Forgot to say: thank you!  (for the fix and the debugging help)
You have been very patient.

*shuffles off to sleep*



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-09-02 Thread Olaf van der Spek
On Thu, Sep 2, 2010 at 2:13 PM, Jonathan Nieder jrnie...@gmail.com wrote:
 # killall apache2
 # dpkg --configure -a
 Setting up lighttpd (1.4.28-1) ...
 Starting web server: lighttpd.
 # echo $?
 0

 I had uninstalled but not purged apache and clearly I do not know
 how to use netstat. :(

You're kidding me, right? :p
I guess uninstalling didn't succeed either.

Olaf



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-09-02 Thread Jonathan Nieder
Olaf van der Spek wrote:

 I guess uninstalling didn't succeed either.

Right, I removed the apache2 package but not the daemon (apache2-mpm-worker)
itself.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-09-01 Thread Olaf van der Spek
On Wed, Sep 1, 2010 at 3:29 AM, Jonathan Nieder jrnie...@gmail.com wrote:
  net.ipv6.bindv6only = 1

 Wait, wasn't that changed back in netbase?  Well, yes, for _new_
 installs, but this is a conffile so it keeps the existing value
 for existing installations.

That sucks, IMO it should've been set to 0 before the file being removed.

 My own analysis is the same as before: relying on anything about
 the bindv6only setting is just asking for trouble.  lighttpd needs to
 set or clear the IPV6_V6ONLY option itself for ipv6 sockets, or
 autoconfigure correctly at runtime.

This bug was about Lighttpd relying on v6only = 1. So in your case it
should've worked.
Lighttpd actually sets v6only = 1 itself (AFAIK) now.
Could you try with a clean conf and post a strace of the error?

Olaf



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-08-31 Thread Jonathan Nieder
reopen 564556 lighttpd/1.4.28-1
quit

Thijs Kinkhorst wrote:

  lighttpd (1.4.28-1) unstable; urgency=low
  .
[ Olaf van der Spek ]
* New upstream release (closes: 521235, 572031, 564556)

 $ cupt install lighttpd
 [...]
 Unpacking lighttpd (from .../lighttpd_1.4.28-1_i386.deb) ...
 Setting up lighttpd (1.4.28-1) ...
 Starting web server: lighttpd2010-08-31 20:21:48: (network.c.358) can't bind 
to port:  80 Address already in use 
  failed!
 invoke-rc.d: initscript lighttpd, action start failed.
 dpkg: error processing lighttpd (--configure):

Hmph.  Actually though the symptoms are the same, the cause is
different.

 # cat /proc/sys/net/ipv6/bindv6only 
 1
 $ tail -1 /etc/sysctl.d/bindv6only.conf 
 net.ipv6.bindv6only = 1

Wait, wasn't that changed back in netbase?  Well, yes, for _new_
installs, but this is a conffile so it keeps the existing value
for existing installations.

My own analysis is the same as before: relying on anything about
the bindv6only setting is just asking for trouble.  lighttpd needs to
set or clear the IPV6_V6ONLY option itself for ipv6 sockets, or
autoconfigure correctly at runtime.

Hope that helps,
Jonathan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-31 Thread Timo Juhani Lindfors
Hi,

not sure if it is relevant at all anymore but I hit this too in the
following environment:

* debian stable
* custom kernel with CONFIG_IPV6=y
* debian unstable chroot for testing unstable packages

Obviously /proc/sys/net/ipv6/bindv6only is false since it is not set
by the debian stable system. (And as noted earlier setting it to true
would destroy java networking from all other users of the system.)

I can confirm that changing

#include_shell /usr/share/lighttpd/use-ipv6.pl

to

server.socket = [::]:80

indeed makes it possible to start lighttpd.




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address

2010-05-23 Thread Olaf van der Spek
2010/5/23 Stefan Bühler stbueh...@lighttpd.net:
 I think i already wrote this: I don't think it is a good idea to
 automatically enable ipv6: it neither works with the wrong bindv6only
 nor with server.port != 80.

 Dropping the script would fix these issues; providing a simple example line
 in the default config should be enough imho (the people who want ipv6 know
 they have to configure most services to use it anyway):

http://wiki.debian.org/ReleaseGoals/FullIPv6Support

Debian's goal is to have out-of-the-box IPv6 support in all daemons.

Not enabling IPv6 is not a solution.

Olaf



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address

2010-05-23 Thread Stefan Bühler

On 05/23/2010 11:26 AM, Olaf van der Spek wrote:

http://wiki.debian.org/ReleaseGoals/FullIPv6Support

Debian's goal is to have out-of-the-box IPv6 support in all daemons.

Not enabling IPv6 is not a solution.

Olaf


I think there is a difference between supporting something and enabling
it by default.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address

2010-05-23 Thread Olaf van der Spek
2010/5/23 Stefan Bühler stbueh...@lighttpd.net:
 On 05/23/2010 11:26 AM, Olaf van der Spek wrote:

 http://wiki.debian.org/ReleaseGoals/FullIPv6Support

 Debian's goal is to have out-of-the-box IPv6 support in all daemons.

 Not enabling IPv6 is not a solution.

 Olaf

 I think there is a difference between supporting something and enabling
 it by default.

True, but I think the intent is to have it enabled by default as well.

-- 
Olaf



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Jonathan Nieder
Olaf van der Spek wrote:

 I think the problem was that I compiled Linux with CONFIG_IPV6=m.
 
 So this is no longer a problem?

I’m using a Debian kernel now; I’ll try rebuilding a kernel with ipv6
disabled and get back to you in the next few days.

Was this fixed upstream or something?

Jonathan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Olaf van der Spek
On Sat, May 22, 2010 at 9:51 PM, Jonathan Nieder jrnie...@gmail.com wrote:
 Olaf van der Spek wrote:

 I think the problem was that I compiled Linux with CONFIG_IPV6=m.

 So this is no longer a problem?

 I’m using a Debian kernel now; I’ll try rebuilding a kernel with ipv6
 disabled and get back to you in the next few days.

 Was this fixed upstream or something?

I thought the problem was caused by your kernel option.
bindv6only is now enabled by default in netbase AFAIK.

Olaf



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Jonathan Nieder
Olaf van der Spek wrote:

 I thought the problem was caused by your kernel option.
 bindv6only is now enabled by default in netbase AFAIK.

Maybe it could be considered a kernel bug: if ipv6 support is disabled
(because built as a module) at the time the netbase init script runs,
then it cannot enable bindv6only.  The sysctl errors out.

But surely programs should not be relying on bindv6only to be set!
That is just asking for trouble.  There _are_ going to be
administrators who disable it, and we should accomodate them.  In
other words, lighttpd needs to set or clear the IPV6_V6ONLY option
itself for ipv6 sockets.

Jonathan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: [pkg-lighttpd] Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Olaf van der Spek
On Sat, May 22, 2010 at 10:09 PM, Jonathan Nieder jrnie...@gmail.com wrote:
 Olaf van der Spek wrote:

 I thought the problem was caused by your kernel option.
 bindv6only is now enabled by default in netbase AFAIK.

 Maybe it could be considered a kernel bug: if ipv6 support is disabled
 (because built as a module) at the time the netbase init script runs,
 then it cannot enable bindv6only.  The sysctl errors out.

 But surely programs should not be relying on bindv6only to be set!
 That is just asking for trouble.  There _are_ going to be
 administrators who disable it, and we should accomodate them.  In
 other words, lighttpd needs to set or clear the IPV6_V6ONLY option
 itself for ipv6 sockets.

I think Lighttpd does set it now.

-- 
Olaf



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Jonathan Nieder
tags 564556 - moreinfo
found 564556 lighttpd/1.4.26-1.1
severity 564556 important
quit

Olaf van der Spek wrote:
 Jonathan Nieder jrnie...@gmail.com wrote:

 But surely programs should not be relying on bindv6only to be set!
 That is just asking for trouble.  There _are_ going to be
 administrators who disable it, and we should accomodate them.  In
 other words, lighttpd needs to set or clear the IPV6_V6ONLY option
 itself for ipv6 sockets.

 I think Lighttpd does set it now.

It seems not, unfortunately.  With a standard Debian kernel:

| # sysctl net.ipv6.bindv6only=0
| net.ipv6.bindv6only = 0
| #
| # cupt install lighttpd
| [...]
| Setting up lighttpd (1.4.26-1.1) ...
| Starting web server: lighttpd/usr/sbin/lighttpd: Symbol `FamErrlist' has 
different size in shared object, consider re-linking
| 2010-05-22 15:20:00: (network.c.345) can't bind to port: :: 80 Address 
already in use 
|  failed!
| [...]
| # uname -r
| 2.6.33-2-686

Hope that helps,
Jonathan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Olaf van der Spek
On Sat, May 22, 2010 at 10:27 PM, Jonathan Nieder jrnie...@gmail.com wrote:
 severity 564556 important

Why did this become important (from minor)?

 Olaf van der Spek wrote:
 Jonathan Nieder jrnie...@gmail.com wrote:
 It seems not, unfortunately.  With a standard Debian kernel:

Hmm, you're right.
By next version they meant next major version.

Olaf



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Jonathan Nieder
Olaf van der Spek wrote:

 Why did this become important (from minor)?

Before, I had not understood the problem and thought it might only
affect me.  Now it is clear it will affect anyone with bindv6only
unset.

I consider this important and if I find time, I’ll write a patch.
But I would not be upset if you disagree (and reassign the severity
accordingly).

 By next version they meant next major version.

Thanks for the clarification.

Jonathan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Olaf van der Spek
On Sat, May 22, 2010 at 10:57 PM, Jonathan Nieder jrnie...@gmail.com wrote:
 Olaf van der Spek wrote:

 Why did this become important (from minor)?

 Before, I had not understood the problem and thought it might only
 affect me.  Now it is clear it will affect anyone with bindv6only
 unset.

Why would someone unset it?
-- 
Olaf



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-05-22 Thread Jonathan Nieder
Olaf van der Spek wrote:

 Why would someone unset it?

Today?  Java[1].

Not to mention it is not yet clear whether bindv6only will be the
default in squeeze[2].

Jonathan

[1] http://bugs.debian.org/566690
[2] http://bugs.debian.org/560238#70
From http://lists.debian.org/debian-devel/2010/04/msg00449.html:

 - as explained in #560238, it is still not the time to make a choice.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address

2010-05-22 Thread Stefan Bühler
I think i already wrote this: I don't think it is a good idea to 
automatically enable ipv6: it neither works with the wrong bindv6only

nor with server.port != 80.

Dropping the script would fix these issues; providing a simple example 
line in the default config should be enough imho (the people who want 
ipv6 know they have to configure most services to use it anyway):


# uncomment to listen to ipv6:
# (if you still have bindv6only=0 use
#  server.use-ipv6 = enable instead)
# $SERVER[socket] == [::]:80 { }

Stefan
(upstream dev)

PS: We still think about enforcing BINDV6ONLY upstream (we probably 
would add a use-the-old-way option for some time) in 1.4.x; but

I don't think it will come in 1.4.27, perhaps 1.4.28.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-01-13 Thread Jonathan Nieder
Hi,

For the morbidly curious:

Jonathan Nieder wrote:

 The problem is that (why? I don't know, but that's a separate problem)
 the bindv6only sysctl is not enabled.  Enabling it fixes this.

I think the problem was that I compiled Linux with CONFIG_IPV6=m.
*sigh*

 Even better, lighttpd could set the IPV6_V6ONLY option itself
 and not rely on net.ipv6.bindv6only being set.

The next official version of lighttpd may do this [1], so our long
national nightmare might be over soon.

Regards,
Jonathan

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560837#38



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#564556: lighttpd: can't bind to port: :: 80 Address already in use

2010-01-09 Thread Jonathan Nieder
Package: lighttpd
Version: 1.4.25-2
Severity: minor

lighttpd refuses to install, seemingly because it is trying to bind
to port 80 twice:

| Setting up lighttpd (1.4.25-2) ...
| Starting web server: lighttpd2010-01-10 00:57:30: (network.c.345) can't bind 
to port: :: 80 Address already in use 
|  failed!

Invoking the init script by hand yields the same result:

| # /etc/init.d/lighttpd restart
| Stopping web server: lighttpd.
| Starting web server: lighttpd2010-01-10 01:24:05: (network.c.345) can't bind 
to port: :: 80 Address already in use 
|  failed!
| # echo $?
| 1

I do not have any other web server installed, nor is any other
program listening on port 80.

| $ netstat -a | awk '($1 != unix)  ($6 == LISTEN)'
| tcp0  0 *:ssh   *:* LISTEN
 
| tcp0  0 localhost:smtp  *:* LISTEN
 
| tcp6   0  0 [::]:ssh[::]:*  LISTEN
 

The problem is that (why? I don't know, but that's a separate problem)
the bindv6only sysctl is not enabled.  Enabling it fixes this.

A clearer error message would have made this easier to diagnose.
Even better, lighttpd could set the IPV6_V6ONLY option itself
and not rely on net.ipv6.bindv6only being set.

Thoughts?
Jonathan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org