FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 05-21-2011, 01:01 PM
Marc Haber
 
Default How to solve race condition between IPv6 ifup and start of services?

Hi,

with the increasing deployment of IPv6 I begin to see an issue
icreasingly often: When an interface is configured for IPv6, it takes
a few seconds before the IPv6 address actually becomes available.
Services that are started in this time window won't listen on IPv6,
which may be unintended behavior. Many people see this behavior as a
bug in the distribution, which is why I am addressing this issue here
on -devel.

Unfortunately, it is non-trivial to find out whether my IPv6
configuration has completed or not. How many addresses will be
assigned to us via stateless autoconfig? Are we running with privacy
extensions? Do we have additional static configuration?

The most "clean" solutions for this issue would be
(a) Modify the services to notice when additional IP addresses come up
and listen there if the service is configured for that IP address
(b) Parse the configuration of each service in the init script and
wait for the configured IP addresses to actually come up.

Both solutions are rather expensive to implement.

Is there a widely accepted method to do things any easier? It is
clearly not acceptable to have to manually log in to a newly booted
server to restart service, neither do I like the idea of changing
runlevels five minutes after reboot to kick IPv6 services to life.

Any more ideas?

Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: E1QNloJ-0003K1-Ui@swivel.zugschlus.de">http://lists.debian.org/E1QNloJ-0003K1-Ui@swivel.zugschlus.de
 
Old 05-21-2011, 01:31 PM
Ben Hutchings
 
Default How to solve race condition between IPv6 ifup and start of services?

On Sat, 2011-05-21 at 15:01 +0200, Marc Haber wrote:
> Hi,
>
> with the increasing deployment of IPv6 I begin to see an issue
> icreasingly often: When an interface is configured for IPv6, it takes
> a few seconds before the IPv6 address actually becomes available.
> Services that are started in this time window won't listen on IPv6,
> which may be unintended behavior. Many people see this behavior as a
> bug in the distribution, which is why I am addressing this issue here
> on -devel.
>
> Unfortunately, it is non-trivial to find out whether my IPv6
> configuration has completed or not. How many addresses will be
> assigned to us via stateless autoconfig? Are we running with privacy
> extensions? Do we have additional static configuration?
>
> The most "clean" solutions for this issue would be
> (a) Modify the services to notice when additional IP addresses come up
> and listen there if the service is configured for that IP address
> (b) Parse the configuration of each service in the init script and
> wait for the configured IP addresses to actually come up.
[...]

(c) Set the IP_FREEBIND socket option before binding.

Ben.

--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
 
Old 05-21-2011, 01:31 PM
Ben Hutchings
 
Default How to solve race condition between IPv6 ifup and start of services?

On Sat, 2011-05-21 at 15:01 +0200, Marc Haber wrote:
> Hi,
>
> with the increasing deployment of IPv6 I begin to see an issue
> icreasingly often: When an interface is configured for IPv6, it takes
> a few seconds before the IPv6 address actually becomes available.
> Services that are started in this time window won't listen on IPv6,
> which may be unintended behavior. Many people see this behavior as a
> bug in the distribution, which is why I am addressing this issue here
> on -devel.
>
> Unfortunately, it is non-trivial to find out whether my IPv6
> configuration has completed or not. How many addresses will be
> assigned to us via stateless autoconfig? Are we running with privacy
> extensions? Do we have additional static configuration?
>
> The most "clean" solutions for this issue would be
> (a) Modify the services to notice when additional IP addresses come up
> and listen there if the service is configured for that IP address
> (b) Parse the configuration of each service in the init script and
> wait for the configured IP addresses to actually come up.
[...]

(c) Set the IP_FREEBIND socket option before binding.

Ben.

--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
 
Old 05-21-2011, 03:22 PM
Michael Biebl
 
Default How to solve race condition between IPv6 ifup and start of services?

Am 21.05.2011 15:01, schrieb Marc Haber:
>
> The most "clean" solutions for this issue would be
> (a) Modify the services to notice when additional IP addresses come up
> and listen there if the service is configured for that IP address
> (b) Parse the configuration of each service in the init script and
> wait for the configured IP addresses to actually come up.
>
> Both solutions are rather expensive to implement.

A similar issue (not directly IPv6 related) was discussed on fedora-devel not
very long ago. It was about the more "dynamic" nature of NetworkManager and how
certain services currently don't cope with the network not being up and fully
configured, when they start up. [1]

See some suggestions how to address this are at [2].

HTH,
Michael

[1] http://lists.fedoraproject.org/pipermail/devel/2011-May/151254.html
[2] http://lists.fedoraproject.org/pipermail/devel/2011-May/151272.html
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
 
Old 05-21-2011, 06:29 PM
Marc Haber
 
Default How to solve race condition between IPv6 ifup and start of services?

On Sat, 21 May 2011 14:31:45 +0100, Ben Hutchings
<ben@decadent.org.uk> wrote:
>On Sat, 2011-05-21 at 15:01 +0200, Marc Haber wrote:
>> with the increasing deployment of IPv6 I begin to see an issue
>> icreasingly often: When an interface is configured for IPv6, it takes
>> a few seconds before the IPv6 address actually becomes available.
>> Services that are started in this time window won't listen on IPv6,
>> which may be unintended behavior. Many people see this behavior as a
>> bug in the distribution, which is why I am addressing this issue here
>> on -devel.
>>
>> Unfortunately, it is non-trivial to find out whether my IPv6
>> configuration has completed or not. How many addresses will be
>> assigned to us via stateless autoconfig? Are we running with privacy
>> extensions? Do we have additional static configuration?
>>
>> The most "clean" solutions for this issue would be
>> (a) Modify the services to notice when additional IP addresses come up
>> and listen there if the service is configured for that IP address
>> (b) Parse the configuration of each service in the init script and
>> wait for the configured IP addresses to actually come up.
>[...]
>
>(c) Set the IP_FREEBIND socket option before binding.

What does this do? And it needs changes to the software as well.

Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: E1QNqvO-0002lu-Hk@swivel.zugschlus.de">http://lists.debian.org/E1QNqvO-0002lu-Hk@swivel.zugschlus.de
 
Old 05-21-2011, 06:49 PM
Marc Haber
 
Default How to solve race condition between IPv6 ifup and start of services?

On Sat, 21 May 2011 17:22:05 +0200, Michael Biebl <biebl@debian.org>
wrote:
>A similar issue (not directly IPv6 related) was discussed on fedora-devel not
>very long ago. It was about the more "dynamic" nature of NetworkManager and how
>certain services currently don't cope with the network not being up and fully
>configured, when they start up. [1]
>
>See some suggestions how to address this are at [2].

That article says that servers should use FREEBIND or subscribe to
netlink for changes. This is a major effort which needs upstream
cooperation or local patches.

The third option suggests that the network manager option mentioned
there is what one would need for ifupdown, and I don't have the
slightest idea how one could guess whether the networks is "done" now.

Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: E1QNrF3-0003gd-Ce@swivel.zugschlus.de">http://lists.debian.org/E1QNrF3-0003gd-Ce@swivel.zugschlus.de
 
Old 05-21-2011, 09:23 PM
Ben Hutchings
 
Default How to solve race condition between IPv6 ifup and start of services?

On Sat, 2011-05-21 at 20:29 +0200, Marc Haber wrote:
> On Sat, 21 May 2011 14:31:45 +0100, Ben Hutchings
> <ben@decadent.org.uk> wrote:
> >On Sat, 2011-05-21 at 15:01 +0200, Marc Haber wrote:
> >> with the increasing deployment of IPv6 I begin to see an issue
> >> icreasingly often: When an interface is configured for IPv6, it takes
> >> a few seconds before the IPv6 address actually becomes available.
> >> Services that are started in this time window won't listen on IPv6,
> >> which may be unintended behavior. Many people see this behavior as a
> >> bug in the distribution, which is why I am addressing this issue here
> >> on -devel.
> >>
> >> Unfortunately, it is non-trivial to find out whether my IPv6
> >> configuration has completed or not. How many addresses will be
> >> assigned to us via stateless autoconfig? Are we running with privacy
> >> extensions? Do we have additional static configuration?
> >>
> >> The most "clean" solutions for this issue would be
> >> (a) Modify the services to notice when additional IP addresses come up
> >> and listen there if the service is configured for that IP address
> >> (b) Parse the configuration of each service in the init script and
> >> wait for the configured IP addresses to actually come up.
> >[...]
> >
> >(c) Set the IP_FREEBIND socket option before binding.
>
> What does this do? And it needs changes to the software as well.

It allows the socket to be bound to an address that is not (yet) local.
It should be a relatively simple code change. The down-side is that a
typo in the configured bind address no longer results in an error on
startup.

Network interfaces can come and go dynamically, and our packages should
not assume otherwise. As an example, I configure lighttpd to listen on
lo and on a local bridge to VM guests. The bridge is created only when
I actually start some guests, but I don't want lighttpd to wait for it
to be created, nor do I want to have to restart it after the bridge is
created (as I do now).

Ben.

--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
 
Old 05-21-2011, 10:29 PM
Goswin von Brederlow
 
Default How to solve race condition between IPv6 ifup and start of services?

Marc Haber <mh+debian-devel@zugschlus.de> writes:

> Hi,
>
> with the increasing deployment of IPv6 I begin to see an issue
> icreasingly often: When an interface is configured for IPv6, it takes
> a few seconds before the IPv6 address actually becomes available.
> Services that are started in this time window won't listen on IPv6,
> which may be unintended behavior. Many people see this behavior as a
> bug in the distribution, which is why I am addressing this issue here
> on -devel.
>
> Unfortunately, it is non-trivial to find out whether my IPv6
> configuration has completed or not. How many addresses will be
> assigned to us via stateless autoconfig? Are we running with privacy
> extensions? Do we have additional static configuration?
>
> The most "clean" solutions for this issue would be
> (a) Modify the services to notice when additional IP addresses come up
> and listen there if the service is configured for that IP address
> (b) Parse the configuration of each service in the init script and
> wait for the configured IP addresses to actually come up.
>
> Both solutions are rather expensive to implement.
>
> Is there a widely accepted method to do things any easier? It is
> clearly not acceptable to have to manually log in to a newly booted
> server to restart service, neither do I like the idea of changing
> runlevels five minutes after reboot to kick IPv6 services to life.
>
> Any more ideas?
>
> Greetings
> Marc

(c) Modify ifupdown to notice when additional IP addresses come up (or
go away) and run the ifup.d (ifdown.d) scripts for it.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87ei3rd6wg.fsf@frosties.localnet">http://lists.debian.org/87ei3rd6wg.fsf@frosties.localnet
 
Old 05-21-2011, 10:42 PM
Steve Langasek
 
Default How to solve race condition between IPv6 ifup and start of services?

On Sat, May 21, 2011 at 03:01:39PM +0200, Marc Haber wrote:
> with the increasing deployment of IPv6 I begin to see an issue
> icreasingly often: When an interface is configured for IPv6, it takes
> a few seconds before the IPv6 address actually becomes available.
> Services that are started in this time window won't listen on IPv6,
> which may be unintended behavior. Many people see this behavior as a
> bug in the distribution, which is why I am addressing this issue here
> on -devel.

> Unfortunately, it is non-trivial to find out whether my IPv6
> configuration has completed or not. How many addresses will be
> assigned to us via stateless autoconfig? Are we running with privacy
> extensions? Do we have additional static configuration?

> The most "clean" solutions for this issue would be
> (a) Modify the services to notice when additional IP addresses come up
> and listen there if the service is configured for that IP address
> (b) Parse the configuration of each service in the init script and
> wait for the configured IP addresses to actually come up.

> Both solutions are rather expensive to implement.

> Is there a widely accepted method to do things any easier? It is
> clearly not acceptable to have to manually log in to a newly booted
> server to restart service, neither do I like the idea of changing
> runlevels five minutes after reboot to kick IPv6 services to life.

> Any more ideas?

With an event-based init system such as upstart, you could also set up the
service not to start until the specified interface is fully configured. But
in general, I agree that upstream software should be intelligent about doing
the right thing when started before the network is up.

Apache, for one, seems to fail at this currently; I have an apache instance
running on my laptop which I want to bind to ipv6, but of course since it's
a roaming laptop, there isn't always an ipv6 address available at startup;
apache thinks this means it should open ipv4-only sockets, requiring a
restart once I'm on an ipv6 network. :/

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110521224251.GB29717@virgil.dodds.net">http://lists.debian.org/20110521224251.GB29717@virgil.dodds.net
 
Old 05-22-2011, 01:11 AM
Ian Jackson
 
Default How to solve race condition between IPv6 ifup and start of services?

Marc Haber writes ("How to solve race condition between IPv6 ifup and start of services?"):
> Unfortunately, it is non-trivial to find out whether my IPv6
> configuration has completed or not. How many addresses will be
> assigned to us via stateless autoconfig? Are we running with privacy
> extensions? Do we have additional static configuration?

This kind of thing is indeed annoying.

In the situation where you know what the IPv6 address is going to be,
you can create a dummy interface (eg lo:0) with that known address,
with fairly straightforward runes in /etc/network/interfaces.

That will enable your programs to bind to the address before
connectivity is available. Of course you may prefer to simply specify
the static IP address for the actual ethernet interface.

> Is there a widely accepted method to do things any easier? It is
> clearly not acceptable to have to manually log in to a newly booted
> server to restart service, neither do I like the idea of changing
> runlevels five minutes after reboot to kick IPv6 services to life.

I set the machine's address statically; this is usually more
appropriate for a server anyway. I do have some local addresses which
are provided by vpn machinery which takes a while to get going, and
for those addresses I have a lo:0 alias so that services can bind to
it in advance.

Ian.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 19928.25252.454915.279781@chiark.greenend.org.uk"> http://lists.debian.org/19928.25252.454915.279781@chiark.greenend.org.uk
 

Thread Tools




All times are GMT. The time now is 09:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org