ifupdown integration does not start ovs daemon

Bug #1731916 reported by jwi
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
openvswitch (Ubuntu)
Fix Released
Low
James Page
Xenial
Triaged
Medium
Unassigned
Bionic
Triaged
Low
Unassigned
Focal
Triaged
Low
Unassigned
Groovy
Triaged
Low
Unassigned
Hirsute
Triaged
Low
Unassigned
Impish
Fix Released
Low
James Page

Bug Description

The debian/ifupdown.sh of openvswitch*.debian.tar.xz contains:

SERVICE_UNIT=/usr/lib/systemd/system/openvswitch-nonetwork.service
if [ -f $SERVICE_UNIT ] && [ -x /usr/bin/systemctl ]; then
    if ! systemctl --quiet is-active openvswitch-nonetwork.service; then
        systemctl start openvswitch-nonetwork.service
    fi
else
    if service openvswitch-switch status > /dev/null 2>&1; then
        service openvswitch-switch start
    fi
fi

However, on a fresh xenial, the files which the first if branch checks for are located at an entirely different place:

vagrant@m1r1:~$ stat /bin/systemctl
  File: '/bin/systemctl'
  Size: 659848 Blocks: 1296 IO Block: 4096 regular file
Device: fd01h/64769d Inode: 655454 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-11-13 10:08:37.460000000 +0000
Modify: 2017-07-18 23:56:57.000000000 +0000
Change: 2017-10-15 18:32:47.985047000 +0000
 Birth: -
vagrant@m1r1:~$ stat /lib/systemd/system/openvswitch-nonetwork.service
  File: '/lib/systemd/system/openvswitch-nonetwork.service'
  Size: 359 Blocks: 8 IO Block: 4096 regular file
Device: fd01h/64769d Inode: 934190 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-11-13 10:38:04.758113095 +0000
Modify: 2017-03-15 12:34:41.000000000 +0000
Change: 2017-11-13 10:38:02.355000434 +0000
 Birth: -
vagrant@m1r1:~$ sudo stat /usr/bin/systemctl
stat: cannot stat '/usr/bin/systemctl': No such file or directory
vagrant@m1r1:~$ sudo stat /usr/lib/systemd/system
stat: cannot stat '/usr/lib/systemd/system': No such file or directory

This leads the ifupdown.sh to take the second branch, but that has a different issue:

vagrant@m1r1:~$ service openvswitch-switch status > /dev/null || echo false
false
vagrant@m1r1:~$ sudo systemctl start openvswitch-switch
vagrant@m1r1:~$ service openvswitch-switch status > /dev/null && echo true
true

That is, the return code appears to be reversed (at least for systems running systemd).

This means that interfaces(5) cannot be used with OpenvSwitch and `auto` at all, because openvswitch isn’t started automatically.

I think the paths should be fixed (the correct paths are above).

$ lsb_release -rd
Description: Ubuntu 16.04.3 LTS
Release: 16.04
# apt-cache policy openvswitch-switch
openvswitch-switch:
  Installed: (none)
  Candidate: 2.5.2-0ubuntu0.16.04.3
  Version table:
     2.5.2-0ubuntu0.16.04.3 500
        500 http://de.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     2.5.2-0ubuntu0.16.04.2 500
        500 http://de.archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     2.5.0-0ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial/main amd64 Packages

Expected behaviour: using `auto` with an OpenvSwitch thing in /etc/network/interfaces should start openvswitch if it isn’t running.

Actual behaviour: Openvswitch is not started and the interfaces do not come up.

Note: changing the paths as suggested above fixes the issue for me.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openvswitch (Ubuntu):
status: New → Confirmed
Revision history for this message
Peter Kieser (pfak) wrote :

Verified that this does indeed fix the problem.
Here is a fix to the package.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "bug-1731916-ifupdown.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
James Page (james-page)
Changed in openvswitch (Ubuntu):
status: Confirmed → Triaged
Changed in openvswitch (Ubuntu Impish):
importance: Undecided → Low
Changed in openvswitch (Ubuntu Hirsute):
importance: Undecided → Low
Changed in openvswitch (Ubuntu Groovy):
importance: Undecided → Low
Changed in openvswitch (Ubuntu Focal):
importance: Undecided → Low
Changed in openvswitch (Ubuntu Bionic):
importance: Undecided → Low
Changed in openvswitch (Ubuntu Xenial):
importance: Undecided → Medium
Changed in openvswitch (Ubuntu Hirsute):
status: New → Triaged
Changed in openvswitch (Ubuntu Groovy):
status: New → Triaged
Changed in openvswitch (Ubuntu Focal):
status: New → Triaged
Changed in openvswitch (Ubuntu Bionic):
status: New → Triaged
Changed in openvswitch (Ubuntu Xenial):
status: New → Triaged
Changed in openvswitch (Ubuntu Impish):
status: Triaged → In Progress
assignee: nobody → James Page (james-page)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI - Uploaded for impish as part of 2.15.1-0ubuntu1

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

This bug was fixed in the package openvswitch - 2.15.1-0ubuntu1

---------------
openvswitch (2.15.1-0ubuntu1) impish; urgency=medium

  [ Christian Ehrhardt ]
  * New upstream minor release 2.15.1
  * drop d/p/ovs-dev-ovs-ctl-Allow-recording-hostname-separately.patch which
    is upstream in 2.15.1
  * d/control: python3-six bdep is no more needed
  * drop d/p/py3-compat.patch as upstream switched to python3 in 2.15.1

  [ James Page ]
  * d/ifupdown.sh: Correct paths for systemctl and the
    openvswitch-switch systemd unit for ifupdown integration
    (LP: #1731916).

 -- Christian Ehrhardt <email address hidden> Tue, 13 Jul 2021 14:58:38 +0200

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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