[ovs-dev] debian /etc/init.d/openvswitch status

Raymond Burkholder ray at oneunified.net
Wed May 24 01:14:51 UTC 2017


Using a Debian Stretch daily snapshot from a few days ago, systemd looks to be interfering with /etc/init.d/openvswitch.

These are the packages installed:

# dpkg -l | grep openvsw
ii  openvswitch-common            2.6.2~pre+git20161223-3     amd64        Open vSwitch common components
ii  openvswitch-switch            2.6.2~pre+git20161223-3     amd64        Open vSwitch switch implementations
ii  python-openvswitch            2.6.2~pre+git20161223-3     all          Python bindings for Open vSwitch

# uname -a
Linux server 4.9.0-3-amd64 #1 SMP Debian 4.9.25-1 (2017-05-02) x86_64 GNU/Linux

'/etc/init.d/openvswitch status’ will now generate a systemd based status instead of the ovs-ctl status:

 /etc/init.d/openvswitch-switch status
* openvswitch-switch.service - LSB: Open vSwitch switch
   Loaded: loaded (/etc/init.d/openvswitch-switch; generated; vendor preset: enabled)
   Active: active (running) since Wed 2017-05-24 00:52:45 UTC; 5min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 584 ExecStart=/etc/init.d/openvswitch-switch start (code=exited, status=0/SUCCESS)
    Tasks: 9 (limit: 4915)
   Memory: 53.4M
      CPU: 2.069s
   CGroup: /system.slice/openvswitch-switch.service

…… and etc.


This interferes with the status request in:

# grep -n  status /usr/share/openvswitch/scripts/ifupdown.sh

35:if /etc/init.d/openvswitch-switch status > /dev/null 2>&1; then :; else
36-    /etc/init.d/openvswitch-switch start

As a quick and dirty work around, I changed it to:

# grep -n status /usr/share/openvswitch/scripts/ifupdown.sh

35:if /etc/init.d/openvswitch-switch ovsstatus > /dev/null 2>&1; then :; else
36-    /etc/init.d/openvswitch-switch start

As a result, I had to perform a selective s/status/ovsstatus/ in:

the init file:
/etc/init.d/openvswitch

as well as:
 grep -n status /usr/share/openvswitch/scripts/*
/usr/share/openvswitch/scripts/ifupdown.sh:35:if /etc/init.d/openvswitch-switch ovsstatus > /dev/null 2>&1; then :; else
/usr/share/openvswitch/scripts/ovs-ctl:699:    ovsstatus)
/usr/share/openvswitch/scripts/ovs-lib:52:        "ovsstatus”)

========

As part of these changes for systemd related systems, it may also be suggested to add /lib/systemd/system/openvswitch-nonetwork.service as suggested at:

https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/1448254/comments/5

=========

All this then allows an /etc/network/interfaces file like the following to be properly processed:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

allow-ovs ovsbr0
iface ovsbr0 inet static
    address 10.1.1.10
    netmask 255.255.255.0
    gateway 10.1.1.1
    ovs_type OVSBridge
    ovs_ports eno1

allow-ovsbr0 eno1
iface eno1 inet manual
    ovs_bridge ovsbr0
    ovs_type OVSPort


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the dev mailing list