From 2747f9a26bc0b83c136eaa3113dbe3a2baf111a5 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Mon, 11 Jan 2021 21:09:32 +0100 Subject: [PATCH] * Reworked .service files to make them look like in Ubuntu (as I still want our packages converge). --- debian/changelog | 7 ++++++ ...witch-switch.openvswitch-nonetwork.service | 15 ------------ .../openvswitch-switch.ovs-vswitchd.service | 24 +++++++++++++++++++ .../openvswitch-switch.ovsdb-server.service | 21 ++++++++++++++++ debian/openvswitch-switch.service | 13 ++++++---- 5 files changed, 60 insertions(+), 20 deletions(-) delete mode 100644 debian/openvswitch-switch.openvswitch-nonetwork.service create mode 100644 debian/openvswitch-switch.ovs-vswitchd.service create mode 100644 debian/openvswitch-switch.ovsdb-server.service diff --git a/debian/changelog b/debian/changelog index 0d099d82b..a02a3bbe3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +openvswitch (2.15.0~git20210104.def6eb1ea+dfsg1-3) unstable; urgency=medium + + * Reworked .service files to make them look like in Ubuntu (as I still want + our packages converge). + + -- Thomas Goirand Mon, 11 Jan 2021 21:08:37 +0100 + openvswitch (2.15.0~git20210104.def6eb1ea+dfsg1-2) unstable; urgency=medium * Blacklist more tests for mipsel and mipsel64. diff --git a/debian/openvswitch-switch.openvswitch-nonetwork.service b/debian/openvswitch-switch.openvswitch-nonetwork.service deleted file mode 100644 index ba09af39a..000000000 --- a/debian/openvswitch-switch.openvswitch-nonetwork.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Open vSwitch Internal Unit -PartOf=openvswitch-switch.service -DefaultDependencies=no -After=apparmor.service local-fs.target systemd-tmpfiles-setup.service dpdk.service -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 $OVS_CTL_OPTS -ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop diff --git a/debian/openvswitch-switch.ovs-vswitchd.service b/debian/openvswitch-switch.ovs-vswitchd.service new file mode 100644 index 000000000..f2c080e16 --- /dev/null +++ b/debian/openvswitch-switch.ovs-vswitchd.service @@ -0,0 +1,24 @@ +[Unit] +Description=Open vSwitch Forwarding Unit +After=ovsdb-server.service network-pre.target systemd-udev-settle.service +Before=network.target networking.service +Requires=ovsdb-server.service +ReloadPropagatedFrom=ovsdb-server.service +AssertPathIsReadWrite=/var/run/openvswitch/db.sock +PartOf=openvswitch-switch.service +DefaultDependencies=no + +[Service] +LimitNOFILE=1048576 +Type=forking +Restart=on-failure +Environment=HOME=/var/run/openvswitch +EnvironmentFile=-/etc/default/openvswitch-switch +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ + --no-ovsdb-server --no-monitor --system-id=random \ + start $OVS_CTL_OPTS +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop +ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server \ + --no-monitor --system-id=random \ + restart $OVS_CTL_OPTS +TimeoutSec=300 diff --git a/debian/openvswitch-switch.ovsdb-server.service b/debian/openvswitch-switch.ovsdb-server.service new file mode 100644 index 000000000..2b37229fb --- /dev/null +++ b/debian/openvswitch-switch.ovsdb-server.service @@ -0,0 +1,21 @@ +[Unit] +Description=Open vSwitch Database Unit +After=syslog.target network-pre.target dpdk.service local-fs.target +Before=network.target networking.service +PartOf=openvswitch-switch.service +DefaultDependencies=no + +[Service] +LimitNOFILE=1048576 +Type=forking +Restart=on-failure +EnvironmentFile=-/etc/default/openvswitch-switch +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ + --no-ovs-vswitchd --no-monitor --system-id=random \ + start $OVS_CTL_OPTS +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop +ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \ + --no-monitor restart $OVS_CTL_OPTS +RuntimeDirectory=openvswitch +RuntimeDirectoryMode=0755 +RuntimeDirectoryPreserve=yes diff --git a/debian/openvswitch-switch.service b/debian/openvswitch-switch.service index bcfdbe05e..f03f8b3d2 100644 --- a/debian/openvswitch-switch.service +++ b/debian/openvswitch-switch.service @@ -1,13 +1,16 @@ [Unit] Description=Open vSwitch -After=openvswitch-nonetwork.service -Requires=openvswitch-nonetwork.service -Before=networking.service +Before=network.target +After=network-pre.target ovsdb-server.service ovs-vswitchd.service +PartOf=network.target +Requires=ovsdb-server.service +Requires=ovs-vswitchd.service [Service] Type=oneshot -ExecStart=/etc/init.d/openvswitch-switch systemd-start -ExecStop=/etc/init.d/openvswitch-switch systemd-stop +ExecStart=/bin/true +ExecReload=/usr/share/openvswitch/scripts/ovs-systemd-reload +ExecStop=/bin/true RemainAfterExit=yes [Install] -- 2.39.2