networking is not actually brought down/up when moving to/from runlevel 1

Bug #752481 reported by Clint Byrum
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
Fix Released
Medium
Stéphane Graber

Bug Description

Binary package hint: ifupdown

Since the transition where networking has been handled largely by upstart, runlevel 1 does not bring down the network. Nor is it brought back up in any way by the transition back to runlevel 2.

Related branches

tags: added: upstart
tags: added: runlevel1
Revision history for this message
Stéphane Graber (stgraber) wrote :

So, starting with 12.10 both /etc/init/networking.conf and /etc/init.d/networking will be the same upstart job and will include a post-stop target calling ifdown -a.

So in theory, I could change it to stop on switching to runlevel1 and start on switches to [2345], I'm just not convinced it's a good idea as we don't really support "ifdown -a && ifup -a" because of devices being hot-pluggable and sometimes requiring specific bring-up order that wouldn't be respected by calling "ifup -a".

Changed in ifupdown (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Steve Langasek (vorlon) wrote :

fwiw, while preparing a 'networking' upstart job for Debian, I've found that we will need a 'stop' rule there so that services are currently torn down on shutdown (otherwise, anything after 'networking' in the shutdown sequence never gets run). So I think we want to implement this, though we probably *don't* want to do it with a flat 'stop on runlevel [016]' since that would tear the network out from under any network filesystems before they've been unmounted.

Revision history for this message
Steve Langasek (vorlon) wrote :

Here's a small patch to the networking job to take care of shutting down the networking service when filesystems are unmounted, and starting it again when re-entering a runlevel where networking is wanted. Stéphane, could you review this and see if you think it makes sense to apply?

Note that this is insufficient to address the runlevel 1 case, because network filesystems aren't being unmounted when we enter runlevel 1; another change would be needed to initscripts as well. I don't know why the initscripts package isn't already doing this, that seems very strange to me given the definition of runlevel 1.

Steve Langasek (vorlon)
Changed in ifupdown (Ubuntu):
assignee: nobody → Stéphane Graber (stgraber)
tags: added: patch
Revision history for this message
Stéphane Graber (stgraber) wrote :

Can't think of any downside to that change which wouldn't be a bug by itself, so I'll upload that change. Thanks for the patch.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ifupdown - 0.7.1ubuntu3

---------------
ifupdown (0.7.1ubuntu3) quantal; urgency=low

  * Add a 'stop on' rule for the networking service, so that we tear the
    network down at the correct point in the shutdown sequence (after remote
    filesystems have been unmounted). This is mostly needed when using
    insserv upstart integration (not yet in Ubuntu) to ensure the shutdown
    doesn't hang waiting for an unsatisfiable init script dependency, but it
    also addresses the need for shutting down networking on runlevel changes
    - provided that umountnfs.sh itself is called for runlevel 1, which it
    currently is not.
  * Also start the job on runlevel [2345]. This is a no-op during a normal
    boot since the network will be started *before* runlevel is emitted, but
    is needed to restart the network after a change from runlevel 1.
    LP: #752481.
 -- Steve Langasek <email address hidden> Thu, 06 Sep 2012 15:05:32 -0400

Changed in ifupdown (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.