diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2020-10-20 14:59:28 +0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-10-27 23:24:47 -0400 |
| commit | 28cca9a78e91adc800e079588797df4cf82a378b (patch) | |
| tree | 830b3bb74d9949bb82d6624cc1d6188f3b72f409 | |
| parent | 9d5d904f8abd2ae6ef2351751eb82f44024bbb35 (diff) | |
| download | meta-virtualization-28cca9a78e91adc800e079588797df4cf82a378b.tar.gz | |
openvswitch: use /run instead of /var/run in systemd service file
/var/run has been deprecated by systemd, so use /run instead,
as suggested by systemd.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-networking/openvswitch/files/0001-ovs-use-run-instead-of-var-run-for-in-systemd-units.patch | 102 | ||||
| -rw-r--r-- | recipes-networking/openvswitch/openvswitch_git.bb | 1 |
2 files changed, 103 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/files/0001-ovs-use-run-instead-of-var-run-for-in-systemd-units.patch b/recipes-networking/openvswitch/files/0001-ovs-use-run-instead-of-var-run-for-in-systemd-units.patch new file mode 100644 index 00000000..244a216d --- /dev/null +++ b/recipes-networking/openvswitch/files/0001-ovs-use-run-instead-of-var-run-for-in-systemd-units.patch | |||
| @@ -0,0 +1,102 @@ | |||
| 1 | From ea98129777784b0e750a20078f01093dbdbe7b9b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
| 3 | Date: Tue, 20 Oct 2020 14:14:06 +0800 | ||
| 4 | Subject: [PATCH] ovs: use /run instead of /var/run for in systemd units | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
| 9 | --- | ||
| 10 | rhel/etc_logrotate.d_openvswitch | 4 ++-- | ||
| 11 | rhel/usr_lib_systemd_system_openvswitch-ipsec.service | 2 +- | ||
| 12 | ...sr_lib_systemd_system_ovs-delete-transient-ports.service | 2 +- | ||
| 13 | rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | 6 +++--- | ||
| 14 | rhel/usr_lib_systemd_system_ovsdb-server.service | 6 +++--- | ||
| 15 | 5 files changed, 10 insertions(+), 10 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/rhel/etc_logrotate.d_openvswitch b/rhel/etc_logrotate.d_openvswitch | ||
| 18 | index f4302ffbc..c0f476744 100644 | ||
| 19 | --- a/rhel/etc_logrotate.d_openvswitch | ||
| 20 | +++ b/rhel/etc_logrotate.d_openvswitch | ||
| 21 | @@ -13,8 +13,8 @@ | ||
| 22 | missingok | ||
| 23 | postrotate | ||
| 24 | # Tell Open vSwitch daemons to reopen their log files | ||
| 25 | - if [ -d /var/run/openvswitch ]; then | ||
| 26 | - for ctl in /var/run/openvswitch/*.ctl; do | ||
| 27 | + if [ -d /run/openvswitch ]; then | ||
| 28 | + for ctl in /run/openvswitch/*.ctl; do | ||
| 29 | ovs-appctl -t "$ctl" vlog/reopen 2>/dev/null || : | ||
| 30 | done | ||
| 31 | fi | ||
| 32 | diff --git a/rhel/usr_lib_systemd_system_openvswitch-ipsec.service b/rhel/usr_lib_systemd_system_openvswitch-ipsec.service | ||
| 33 | index d8f47af68..92dad44f9 100644 | ||
| 34 | --- a/rhel/usr_lib_systemd_system_openvswitch-ipsec.service | ||
| 35 | +++ b/rhel/usr_lib_systemd_system_openvswitch-ipsec.service | ||
| 36 | @@ -5,7 +5,7 @@ After=openvswitch.service | ||
| 37 | |||
| 38 | [Service] | ||
| 39 | Type=forking | ||
| 40 | -PIDFile=/var/run/openvswitch/ovs-monitor-ipsec.pid | ||
| 41 | +PIDFile=/run/openvswitch/ovs-monitor-ipsec.pid | ||
| 42 | ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ | ||
| 43 | --ike-daemon=libreswan start-ovs-ipsec | ||
| 44 | ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop-ovs-ipsec | ||
| 45 | diff --git a/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service | ||
| 46 | index 4cd4d7f57..d4d7b204b 100644 | ||
| 47 | --- a/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service | ||
| 48 | +++ b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service | ||
| 49 | @@ -2,7 +2,7 @@ | ||
| 50 | Description=Open vSwitch Delete Transient Ports | ||
| 51 | After=ovsdb-server.service | ||
| 52 | Before=ovs-vswitchd.service | ||
| 53 | -AssertPathExists=/var/run/openvswitch/db.sock | ||
| 54 | +AssertPathExists=/run/openvswitch/db.sock | ||
| 55 | |||
| 56 | [Service] | ||
| 57 | Type=oneshot | ||
| 58 | diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | ||
| 59 | index f88b57cae..82748bf2d 100644 | ||
| 60 | --- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | ||
| 61 | +++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | ||
| 62 | @@ -4,14 +4,14 @@ After=ovsdb-server.service network-pre.target systemd-udev-settle.service | ||
| 63 | Before=network.target network.service | ||
| 64 | Requires=ovsdb-server.service | ||
| 65 | ReloadPropagatedFrom=ovsdb-server.service | ||
| 66 | -AssertPathIsReadWrite=/var/run/openvswitch/db.sock | ||
| 67 | +AssertPathIsReadWrite=/run/openvswitch/db.sock | ||
| 68 | PartOf=openvswitch.service | ||
| 69 | |||
| 70 | [Service] | ||
| 71 | Type=forking | ||
| 72 | -PIDFile=/var/run/openvswitch/ovs-vswitchd.pid | ||
| 73 | +PIDFile=/run/openvswitch/ovs-vswitchd.pid | ||
| 74 | Restart=on-failure | ||
| 75 | -Environment=XDG_RUNTIME_DIR=/var/run/openvswitch | ||
| 76 | +Environment=XDG_RUNTIME_DIR=/run/openvswitch | ||
| 77 | EnvironmentFile=/etc/openvswitch/default.conf | ||
| 78 | EnvironmentFile=-/etc/sysconfig/openvswitch | ||
| 79 | EnvironmentFile=-/run/openvswitch.useropts | ||
| 80 | diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service | ||
| 81 | index 69b0bf61a..5f83f281f 100644 | ||
| 82 | --- a/rhel/usr_lib_systemd_system_ovsdb-server.service | ||
| 83 | +++ b/rhel/usr_lib_systemd_system_ovsdb-server.service | ||
| 84 | @@ -7,12 +7,12 @@ PartOf=openvswitch.service | ||
| 85 | |||
| 86 | [Service] | ||
| 87 | Type=forking | ||
| 88 | -PIDFile=/var/run/openvswitch/ovsdb-server.pid | ||
| 89 | +PIDFile=/run/openvswitch/ovsdb-server.pid | ||
| 90 | Restart=on-failure | ||
| 91 | EnvironmentFile=/etc/openvswitch/default.conf | ||
| 92 | EnvironmentFile=-/etc/sysconfig/openvswitch | ||
| 93 | -ExecStartPre=-/bin/mkdir /var/run/openvswitch /var/log/openvswitch | ||
| 94 | -ExecStartPre=-/bin/chown ${OVS_USER_ID} /var/run/openvswitch /var/log/openvswitch | ||
| 95 | +ExecStartPre=-/bin/mkdir /run/openvswitch /var/log/openvswitch | ||
| 96 | +ExecStartPre=-/bin/chown ${OVS_USER_ID} /run/openvswitch /var/log/openvswitch | ||
| 97 | ExecStartPre=/bin/sh -c 'rm -f /run/openvswitch.useropts; /bin/echo "OVS_USER_ID=${OVS_USER_ID}" > /run/openvswitch.useropts' | ||
| 98 | ExecStartPre=/bin/sh -c 'if [ "$${OVS_USER_ID/:*/}" != "root" ]; then /bin/echo "OVS_USER_OPT=--ovs-user=${OVS_USER_ID}" >> /run/openvswitch.useropts; fi' | ||
| 99 | EnvironmentFile=-/run/openvswitch.useropts | ||
| 100 | -- | ||
| 101 | 2.17.1 | ||
| 102 | |||
diff --git a/recipes-networking/openvswitch/openvswitch_git.bb b/recipes-networking/openvswitch/openvswitch_git.bb index 07258be7..fa1ec4dc 100644 --- a/recipes-networking/openvswitch/openvswitch_git.bb +++ b/recipes-networking/openvswitch/openvswitch_git.bb | |||
| @@ -31,6 +31,7 @@ SRC_URI = "file://openvswitch-switch \ | |||
| 31 | file://python-switch-remaining-scripts-to-use-python3.patch \ | 31 | file://python-switch-remaining-scripts-to-use-python3.patch \ |
| 32 | file://systemd-update-tool-paths.patch \ | 32 | file://systemd-update-tool-paths.patch \ |
| 33 | file://systemd-create-runtime-dirs.patch \ | 33 | file://systemd-create-runtime-dirs.patch \ |
| 34 | file://0001-ovs-use-run-instead-of-var-run-for-in-systemd-units.patch \ | ||
| 34 | " | 35 | " |
| 35 | 36 | ||
| 36 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab" | 37 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab" |
