From c0183506d8fa469633e5fbbbfdede1848d399de8 Mon Sep 17 00:00:00 2001 From: Leonardo Arena Date: Wed, 25 Oct 2023 14:55:44 +0000 Subject: testing/ovn: install more ovs components, add more init scripts --- testing/ovn/ovsdb-server.initd | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 testing/ovn/ovsdb-server.initd (limited to 'testing/ovn/ovsdb-server.initd') diff --git a/testing/ovn/ovsdb-server.initd b/testing/ovn/ovsdb-server.initd new file mode 100644 index 00000000000..65c3f2ef33e --- /dev/null +++ b/testing/ovn/ovsdb-server.initd @@ -0,0 +1,50 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/files/ovsdb-server-r1,v 1.1 2013/04/08 19:37:58 dev-zero Exp $ + +description="Open vSwitch database server" + +remote_punix=${DB_SOCKET:+"--remote=punix:${DB_SOCKET}"} +remote_db=${REMOTE_DB:+"--remote=${REMOTE_DB}"} +private_key=${PRIVATE_KEY:+"--private-key=${PRIVATE_KEY}"} +certificate=${CERTIFICATE:+"--certificate=${CERTIFICATE}"} +bootstrap_ca_cert=${BOOTSTRAP_CA_CERT:+"--bootstrap-ca-cert=${BOOTSTRAP_CA_CERT}"} + +db=${DATABASE:-/etc/openvswitch/conf.db} +dbschema=/usr/share/openvswitch/vswitch.ovsschema + +command="/usr/sbin/ovsdb-server" +command_args=" + --pidfile + --detach + --monitor + ${remote_punix} + ${remote_db} + ${private_key} + ${certificate} + ${bootstrap_ca_cert} + ${DATABASE} + ${OPTIONS}" +pidfile="/var/run/openvswitch/ovsdb-server.pid" + + +depend() { + need localmount dev + after bootmisc hwdrivers modules + before net + use logger +} + +# ovsdb-server is a hard dependency for ovs-vswitchd (to keep them in sync) - to stop the db only: +# /etc/init.d/ovsdb-server --nodeps stop |or| rc-service ovsdb-server -- --nodeps stop + +start_pre() { + checkpath -d "/var/run/openvswitch" -m 0750 + if ! [ -e "$db" ]; then + ovsdb-tool create $db $dbschema + elif [ "$(ovsdb-tool needs-conversion $db $dbschema)" = "yes" ]; then + ovsdb-tool convert $db $dbschema + fi +} + -- cgit v1.2.3