hang in failsafe.conf on precise
Christoph Mathys
eraserix at gmail.com
Wed Apr 25 07:26:59 UTC 2012
I've been refered here from ubuntu-devel-discuss, see below for the problem.
On Tue, Apr 24, 2012 at 3:47 PM, Evan Huus <eapache at gmail.com> wrote:
> On Tue, Apr 24, 2012 at 6:39 AM, Christoph Mathys <eraserix at gmail.com>
> wrote:
>>
>> I just encountered some problems with very long boottimes on precise.
>> failsafe.conf just hangs until the timeout has elapsed.
>>
>> The culprit seems to be that I define interfaces in
>> /etc/network/interfaces that do not exist when I'm testing in kvm
>> (ifup -a fails). This then seems to prevent static-network-up to be
>> emitted. I'm not quite sure why this event is never emitted. Is
>> static-network-up only emitted, if the job networking ("exec ifup -a")
>> runs successfully? (I've disable network-interface.conf)
>
>
> The static-network-up event is emitted by ifup using the
> /etc/network/if-up.d/upstart script, and I believe it's only emitted when
> all the 'auto' interfaces in /etc/network/interfaces are successfully
> brought up (upstart is more my area than networking). The event is necessary
> for boot to proceed safely, so if it doesn't happen, nothing past that point
> will run until the failsafe kicks in after 120 seconds (which is what you're
> seeing).
>
>> As a workaround I think I'll just disable failsafe.conf and write my
>> own job which immediately emits the static-network-up event.
>
>
> You don't have to disable failsafe.conf. As long as something emits
> static-network-up in a reasonable amount of time it won't cause any
> problems, and it's useful to have active in other cases.
True.
> Writing another job that immediately emits the static-network-up event is
> problematic in that it may be run before any network interfaces have
> actually been brought up. This will cause all sorts of trouble for jobs that
> start expecting to find active interfaces but then can't.
Just to be clear: immediately meens "on stopped networking".
ifup/ifdown seem to run pretty synchronous. If I put a script with
"sleep 10" into if-up.d (didn't know about this folder btw, thanks!),
ifup -a will just block for 10s before returning. So I assume the
interfaces are up after ifup -a has returned (from ifups point of
view). If they are not, no amount of waiting will change that, unless
we have some hotplug events that come in and trigger
network-interface.conf, but I don't know if this does happen.
So, whats the reasoning behind implementing this failsafe network configuration?
> I believe the correct thing to do in this case is to remove the offending
> entries from /etc/network/interfaces, since they're apparently unnecessary
> in this particular environment. If there's some reason you'd rather not, try
> sending an email to the upstart-devel [1] mailing list. Someone there might
> know a better workaround.
I can't remove them, they are just not needed for certain tests inside
kvm (e.g. I don't need the fieldbus interface to check software
deployment). In my particular case, I see no benefit in failsafe. All
NICs are there from the start, and if ifup fails, no amount of waiting
will change that. All this failsafe stuff seems to do is penalise me
when some unexpected problem needs to be debugged.
My current "emit static-network-up immediately" job looks as follows.
If there are suggestions for a better solution, I'm listening.
start on filesystem and stopped networking
emits failsafe-boot
console output
script
exec initctl emit --no-wait failsafe-boot
end script
More information about the upstart-devel
mailing list