aboutsummaryrefslogtreecommitdiffstats
path: root/main/openvswitch/ovsdb-server.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-10-09 16:06:12 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-10-09 16:06:12 +0000
commitc2fa69955ac724d03c7c50f155e1a2dabc125c3c (patch)
tree0f13926716058c7d6243a393db5b225b7379d25e /main/openvswitch/ovsdb-server.initd
parent0012ba7c5165d1d8bb45beaa0df24176a8c250c5 (diff)
downloadaports-c2fa69955ac724d03c7c50f155e1a2dabc125c3c.tar.bz2
aports-c2fa69955ac724d03c7c50f155e1a2dabc125c3c.tar.xz
main/openvswitch: move from testing
Diffstat (limited to 'main/openvswitch/ovsdb-server.initd')
-rw-r--r--main/openvswitch/ovsdb-server.initd50
1 files changed, 50 insertions, 0 deletions
diff --git a/main/openvswitch/ovsdb-server.initd b/main/openvswitch/ovsdb-server.initd
new file mode 100644
index 0000000000..29d19045fe
--- /dev/null
+++ b/main/openvswitch/ovsdb-server.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# 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
+}
+