Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openvswitch/, net-misc/openvswitch/files/
Date: Sun, 23 Sep 2018 20:21:55
Message-Id: 1537734097.32da9e276ee7e0af61535e3c9ab605678347ba8e.prometheanfire@gentoo
1 commit: 32da9e276ee7e0af61535e3c9ab605678347ba8e
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 23 20:21:21 2018 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 23 20:21:37 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32da9e27
7
8 net-misc/openvswitch: bumping to 2.10.0-r1 for some systemd changes
9
10 Package-Manager: Portage-2.3.49, Repoman-2.3.11
11 RepoMan-Options: --force
12
13 .../files/ovs-delete-transient-ports.service | 10 +++++++++
14 net-misc/openvswitch/files/ovs-vswitchd2.service | 26 ++++++++++++++++++++++
15 net-misc/openvswitch/files/ovsdb-server2.service | 24 ++++++++++++++++++++
16 net-misc/openvswitch/files/ovsdb-server_conf2 | 3 +++
17 ...-2.10.0.ebuild => openvswitch-2.10.0-r1.ebuild} | 8 ++++---
18 5 files changed, 68 insertions(+), 3 deletions(-)
19
20 diff --git a/net-misc/openvswitch/files/ovs-delete-transient-ports.service b/net-misc/openvswitch/files/ovs-delete-transient-ports.service
21 new file mode 100644
22 index 00000000000..4cd4d7f57f9
23 --- /dev/null
24 +++ b/net-misc/openvswitch/files/ovs-delete-transient-ports.service
25 @@ -0,0 +1,10 @@
26 +[Unit]
27 +Description=Open vSwitch Delete Transient Ports
28 +After=ovsdb-server.service
29 +Before=ovs-vswitchd.service
30 +AssertPathExists=/var/run/openvswitch/db.sock
31 +
32 +[Service]
33 +Type=oneshot
34 +RemainAfterExit=yes
35 +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl delete-transient-ports
36
37 diff --git a/net-misc/openvswitch/files/ovs-vswitchd2.service b/net-misc/openvswitch/files/ovs-vswitchd2.service
38 new file mode 100644
39 index 00000000000..3092fdaaa66
40 --- /dev/null
41 +++ b/net-misc/openvswitch/files/ovs-vswitchd2.service
42 @@ -0,0 +1,26 @@
43 +[Unit]
44 +Description=Open vSwitch Daemon
45 +Documentation=man:ovs-vswitchd
46 +Wants=network.target
47 +Before=network.target network.service
48 +Requires=ovsdb-server.service
49 +After=ovsdb-server.service network-pre.target systemd-udev-settle.service
50 +ReloadPropagatedFrom=ovsdb-server.service
51 +AssertPathIsReadWrite=/var/run/openvswitch/db.sock
52 +
53 +[Service]
54 +Type=forking
55 +Restart=on-failure
56 +Environment=HOME=/var/run/openvswitch
57 +EnvironmentFile=-/run/openvswitch/useropts
58 +EnvironmentFile=-/etc/conf.d/ovs-vswitchd
59 +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
60 + --no-ovsdb-server --no-monitor --system-id=random \
61 + ${OVSUSER} start $OPTIONS
62 +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop
63 +ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server \
64 + --no-monitor --system-id=random ${OVSUSER} restart $OPTIONS
65 +TimeoutSec=300
66 +
67 +[Install]
68 +WantedBy=multi-user.target
69
70 diff --git a/net-misc/openvswitch/files/ovsdb-server2.service b/net-misc/openvswitch/files/ovsdb-server2.service
71 new file mode 100644
72 index 00000000000..5ff6f904466
73 --- /dev/null
74 +++ b/net-misc/openvswitch/files/ovsdb-server2.service
75 @@ -0,0 +1,24 @@
76 +[Unit]
77 +Description=Open vSwitch Database Unit
78 +Documentation=man:ovsdb-server
79 +After=syslog.target network-pre.target
80 +Before=network.target network.service
81 +Wants=ovs-delete-transient-ports.service
82 +
83 +[Service]
84 +Type=forking
85 +Restart=on-failure
86 +EnvironmentFile=-/etc/conf.d/ovsdb-server
87 +ExecStartPre=/bin/chown ${OVS_USER_ID} /var/run/openvswitch /var/log/openvswitch
88 +ExecStartPre=/bin/sh -c 'rm -f /run/openvswitch/useropts; if [ "$${OVS_USER_ID/:*/}" != "root" ]; then /usr/bin/echo "OVSUSER=--ovs-user=${OVS_USER_ID}" > /run/openvswitch/useropts; fi'
89 +EnvironmentFile=-/run/openvswitch/useropts
90 +ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
91 + --no-ovs-vswitchd --no-monitor --system-id=random \
92 + ${OVSUSER} \
93 + start $OPTIONS
94 +ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
95 +ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
96 + ${OVSUSER} \
97 + --no-monitor restart $OPTIONS
98 +RuntimeDirectory=openvswitch
99 +RuntimeDirectoryMode=0755
100
101 diff --git a/net-misc/openvswitch/files/ovsdb-server_conf2 b/net-misc/openvswitch/files/ovsdb-server_conf2
102 index 97367b9717e..07eca5e6c9f 100644
103 --- a/net-misc/openvswitch/files/ovsdb-server_conf2
104 +++ b/net-misc/openvswitch/files/ovsdb-server_conf2
105 @@ -9,6 +9,9 @@ PRIVATE_KEY="db:Open_vSwitch,SSL,private_key"
106 CERTIFICATE="db:Open_vSwitch,SSL,certificate"
107 BOOTSTRAP_CA_CERT="db:Open_vSwitch,SSL,ca_cert"
108
109 +# Default user
110 +OVS_USER_ID="root:root"
111 +
112 # Alternative path for the database (default is /etc/openvswitch/conf.db)
113 # DATABASE="/etc/openvswitch/conf.db"
114
115
116 diff --git a/net-misc/openvswitch/openvswitch-2.10.0.ebuild b/net-misc/openvswitch/openvswitch-2.10.0-r1.ebuild
117 similarity index 92%
118 rename from net-misc/openvswitch/openvswitch-2.10.0.ebuild
119 rename to net-misc/openvswitch/openvswitch-2.10.0-r1.ebuild
120 index b0141c8947f..302aafe58fe 100644
121 --- a/net-misc/openvswitch/openvswitch-2.10.0.ebuild
122 +++ b/net-misc/openvswitch/openvswitch-2.10.0-r1.ebuild
123 @@ -1,4 +1,4 @@
124 -# Copyright 1999-2018 Gentoo Foundation
125 +# Copyright 1999-2018 Gentoo Authors
126 # Distributed under the terms of the GNU General Public License v2
127
128 EAPI=6
129 @@ -106,8 +106,9 @@ src_install() {
130 newinitd "${FILESDIR}/ovsdb-server-r1" ovsdb-server
131 newinitd "${FILESDIR}/ovs-vswitchd-r1" ovs-vswitchd
132
133 - systemd_dounit "${FILESDIR}/ovsdb-server.service"
134 - systemd_dounit "${FILESDIR}/ovs-vswitchd.service"
135 + systemd_newunit "${FILESDIR}/ovsdb-server2.service" ovsdb-server.service
136 + systemd_newunit "${FILESDIR}/ovs-vswitchd2.service" ovs-vswitchd.service
137 + systemd_newunit rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service ovs-delete-transient-ports.service
138 systemd_newtmpfilesd "${FILESDIR}/openvswitch.tmpfiles" openvswitch.conf
139
140 insinto /etc/logrotate.d
141 @@ -131,6 +132,7 @@ pkg_postinst() {
142 fi
143 done
144
145 + # only needed on non-systemd, but helps anyway
146 elog "Use the following command to create an initial database for ovsdb-server:"
147 elog " emerge --config =${CATEGORY}/${PF}"
148 elog "(will create a database in /var/lib/openvswitch/conf.db)"