[Bug 1448254] Re: openvswitch systemd unit file ordering wrong

Mark Dunn mark.dunn at objectiveintegration.uk
Tue Aug 25 09:43:34 UTC 2015


Sorry, lost track of the bug as it fell into 100 papercuts...

if it helps I solved my ordering problem by modifying the
    /lib/systemd/sysytem/openvswitch-nonetwork.service
as follows

    [Unit]
    Description=Open vSwitch Internal Unit
    PartOf=openvswitch-switch.service

    # Without this all sorts of looping dependencies occur doh!
    DefaultDependencies=no

    #precedants pulled from isup@ service requirements
    After=apparmor.service local-fs.target systemd-tmpfiles-setup.service

    #subsequent to this service we need the network to start 
    Wants=network-pre.target openvswitch-switch.service
    Before=network-pre.target openvswitch-switch.service

    [Service]
    Type=oneshot
    RemainAfterExit=yes
    EnvironmentFile=-/etc/default/openvswitch-switch
    ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start \
          --system-id=random $OPTIONS
    ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop

This pulled up the services and allowed my configuration to work

openvswitch-nonetwork.service
● ├─openvswitch-switch.service
● └─network-pre.target
●   ├─ifup at br-eth2.service
●   ├─ifup at br-ex.service
●   ├─ifup at eth0.service
●   ├─ifup at ovs-system.service
●   ├─networking.service
●   └─network.target
●     ├─mysql.service
●     ├─openvswitch-switch.service
●     ├─rabbitmq-server.service
●     ├─rc-local.service
●     ├─ssh.service
●     └─network-online.target
●       ├─apache2.service
●       ├─dns-clean.service
●       └─kerneloops.service

(the dots are green :) )

There is lots of noise on the net about chickens and eggs, so I do not know if it solves some other case
The thing that took me so long to solve it (besides unfamiliarity of systemd) was the AUTOMATIC inclusion of dependencies, who on earth dreamt that up?

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to openvswitch in Ubuntu.
https://bugs.launchpad.net/bugs/1448254

Title:
  openvswitch systemd unit file ordering wrong

Status in One Hundred Papercuts:
  Triaged
Status in openvswitch package in Ubuntu:
  Triaged

Bug description:
  After upgrade to vivid, my system takes nearly 4 minutes to boot. This
  appears to be related to the new systemd unit ordering.

  [Unit]
  Description=Open vSwitch
  After=network.target openvswitch-nonetwork.service
  ...

  root at mystic:/lib/systemd/system# systemd-analyze blame | head
        2min 233ms ifup-wait-all-auto.service
  ...

  Open vSwitch is being started after the network, but the network needs
  Open vSwitch to start since my host traffic is flowing through the
  bridge:

  root at mystic:/lib/systemd/system# ovs-vsctl show
  838a8aa4-4811-447d-8dcc-dbb675b78968
      Bridge "br0"
          Port "br0"
              tag: 1
              Interface "br0"
                  type: internal
          Port "vlan121"
              tag: 121
              Interface "vlan121"
                  type: internal
          Port "eth0"
              tag: 1
              Interface "eth0"
      ovs_version: "2.3.1"

  The interfaces do eventually start correctly, but only after the long
  timeout above.

  ProblemType: Bug
  DistroRelease: Ubuntu 15.04
  Package: openvswitch-switch 2.3.1-0ubuntu1
  ProcVersionSignature: Ubuntu 3.19.0-15.15-generic 3.19.3
  Uname: Linux 3.19.0-15-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 2.17.2-0ubuntu1
  Architecture: amd64
  Date: Fri Apr 24 14:10:19 2015
  EcryptfsInUse: Yes
  ProcEnviron:
   TERM=screen
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: openvswitch
  UpgradeStatus: Upgraded to vivid on 2015-04-24 (0 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/hundredpapercuts/+bug/1448254/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list