improve systemd management of openvswitch daemons

Bug #1585201 reported by Denis Egorenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openvswitch (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Command 'service openvswitch-switch status' gives wrong status report, when process is already running and when it is not running:

# ps auxf | grep openvswitch
root 19115 0.0 0.0 12948 1088 pts/1 S+ 13:17 0:00 \_ grep --color=auto openvswitch
root 17623 0.1 0.6 394040 50476 ? SLl 11:22 0:07 \_ ovs-vswitchd unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log --pidfile=/var/run/openvswitch/ovs-vswitchd.pid --detach --monitor
root 19084 0.0 0.0 20324 3468 ? S 13:11 0:00 \_ ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/var/run/openvswitch/db.sock --private-key=db:Open_vSwitch,SSL,private_key --certificate=db:Open_vSwitch,SSL,certificate --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert --no-chdir --log-file=/var/log/openvswitch/ovsdb-server.log --pidfile=/var/run/openvswitch/ovsdb-server.pid --detach --monitor

# service openvswitch-nonetwork status
● openvswitch-nonetwork.service - Open vSwitch Internal Unit
   Loaded: loaded (/lib/systemd/system/openvswitch-nonetwork.service; static; vendor preset: enabled)
   Active: active (exited) since Tue 2016-05-24 10:26:36 UTC; 2h 45min ago
 Main PID: 14855 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/openvswitch-nonetwork.service

May 24 10:26:36 de-xenial ovs-ctl[14855]: * Starting ovsdb-server
May 24 10:26:36 de-xenial ovs-vsctl[14882]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --no-wait -- init -- set Open_vSwitch . db-version=7.12.1
May 24 10:26:36 de-xenial ovs-vsctl[14887]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --no-wait set Open_vSwitch . ovs-version=2.5.0 "external-ids:system-id=\"681d704d-78ec-4f0e-947d-8caac9ac0e6e\"" "system-type=\"Ubuntu\"" "system-version=
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Configuring Open vSwitch system IDs
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Inserting openvswitch module
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Starting ovs-vswitchd
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Enabling remote OVSDB managers
May 24 10:26:36 de-xenial systemd[1]: Started Open vSwitch Internal Unit.
May 24 10:49:02 de-xenial systemd[1]: Started Open vSwitch Internal Unit.
May 24 10:50:08 de-xenial systemd[1]: Started Open vSwitch Internal Unit.

# service openvswitch-switch status
● openvswitch-switch.service - Open vSwitch
   Loaded: loaded (/lib/systemd/system/openvswitch-switch.service; enabled; vendor preset: enabled)
   Active: active (exited) since Tue 2016-05-24 10:26:36 UTC; 2h 45min ago
 Main PID: 14900 (code=exited, status=0/SUCCESS)

May 24 10:26:36 de-xenial systemd[1]: Starting Open vSwitch...
May 24 10:26:36 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:26:38 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:28:56 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:29:18 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:38:03 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:45:17 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:49:07 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:49:57 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:50:10 de-xenial systemd[1]: Started Open vSwitch.

Then if process will be killed or stopped (for example, kill -9):

# kill -9 17623
# kill -9 19084
#
# ps auxf | grep openvswitch
root 19129 0.0 0.0 12948 1004 pts/1 S+ 13:19 0:00 \_ grep --color=auto openvswitch

We still have same status report:

# service openvswitch-switch status
● openvswitch-switch.service - Open vSwitch
   Loaded: loaded (/lib/systemd/system/openvswitch-switch.service; enabled; vendor preset: enabled)
   Active: active (exited) since Tue 2016-05-24 10:26:36 UTC; 2h 53min ago
 Main PID: 14900 (code=exited, status=0/SUCCESS)

May 24 10:26:36 de-xenial systemd[1]: Starting Open vSwitch...
May 24 10:26:36 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:26:38 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:28:56 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:29:18 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:38:03 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:45:17 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:49:07 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:49:57 de-xenial systemd[1]: Started Open vSwitch.
May 24 10:50:10 de-xenial systemd[1]: Started Open vSwitch.

# service openvswitch-nonetwork status
● openvswitch-nonetwork.service - Open vSwitch Internal Unit
   Loaded: loaded (/lib/systemd/system/openvswitch-nonetwork.service; static; vendor preset: enabled)
   Active: active (exited) since Tue 2016-05-24 10:26:36 UTC; 2h 53min ago
 Main PID: 14855 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/openvswitch-nonetwork.service

May 24 10:26:36 de-xenial ovs-ctl[14855]: * Starting ovsdb-server
May 24 10:26:36 de-xenial ovs-vsctl[14882]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --no-wait -- init -- set Open_vSwitch . db-version=7.12.1
May 24 10:26:36 de-xenial ovs-vsctl[14887]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --no-wait set Open_vSwitch . ovs-version=2.5.0 "external-ids:system-id=\"681d704d-78ec-4f0e-947d-8caac9ac0e6e\"" "system-type=\"Ubuntu\"" "system-version=
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Configuring Open vSwitch system IDs
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Inserting openvswitch module
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Starting ovs-vswitchd
May 24 10:26:36 de-xenial ovs-ctl[14855]: * Enabling remote OVSDB managers
May 24 10:26:36 de-xenial systemd[1]: Started Open vSwitch Internal Unit.
May 24 10:49:02 de-xenial systemd[1]: Started Open vSwitch Internal Unit.
May 24 10:50:08 de-xenial systemd[1]: Started Open vSwitch Internal Unit.

System release:

# lsb_release -rd
Description: Ubuntu 16.04 LTS
Release: 16.04

Package info:

# apt-cache policy openvswitch-switch
openvswitch-switch:
  Installed: 2.5.0-0ubuntu1
  Candidate: 2.5.0-0ubuntu1
  Version table:
 *** 2.5.0-0ubuntu1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

description: updated
Revision history for this message
James Page (james-page) wrote :

This is due to the slight nasty way that ovs was originally integrated with systemd; I think there is a nicer approach using systemd to manage the individual daemons so we should look to see if we can switch to that model.

Changed in openvswitch (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
status: Confirmed → Triaged
summary: - Wrong service status report for openvswitch
+ improve systemd management of openvswitch daemons
Revision history for this message
James Page (james-page) wrote :

https://github.com/openvswitch/ovs/tree/master/rhel contains an improved model for management of all daemons.

Revision history for this message
James Page (james-page) wrote :

openvswitch (2.8.1-0ubuntu3) bionic; urgency=medium

  * Updates to systemd configuration:
    - Move to distinct units for ovsdb-server and ovs-vswitchd.
  * Drop obsolete upstart configuration file.
  * Bump nofiles to 1048576 for ovs daemons (LP: #1737866).
  * d/control: Bump minimum debhelper version to 10, drop BD on
    dh-systemd.
  * d/p/dpif-kernel-gre-mtu-workaround.patch,
    d/p/dpif-netlink-rtnl-Use-65000-instead-of-65535-as-tunnel-MTU.patch:
    Cherry pick in-flight fixes for workaround to correctly set MTU
    of GRE devices via netlink (LP: #1742505).

 -- James Page <email address hidden> Thu, 18 Jan 2018 15:26:41 +0200

Changed in openvswitch (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.