mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +00:00
* Update upstream OVS debian packaging to be on par with package source in Debian/Ubuntu: - Provide a openvswitch-switch-dpdk package that integrates with the dpdk package in the distributions so that end users can opt into a DPDK-enabled Open vSwitch binary. - Provide systemd service files. - Provide openvswitch-source package for reproducible integrated build of for example OVN. - Stop building shared library and subsequently remove libopenvswitch and libopenvswitch-dev binary packages. Co-authored-by: Luca Boccassi <bluca@debian.org> Signed-off-by: Luca Boccassi <bluca@debian.org> Co-authored-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> Co-authored-by: James Page <james.page@ubuntu.com> Signed-off-by: James Page <james.page@ubuntu.com> Co-authored-by: Corey Bryant <corey.bryant@canonical.com> Signed-off-by: Corey Bryant <corey.bryant@canonical.com> Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
82 lines
2.0 KiB
Bash
82 lines
2.0 KiB
Bash
#!/bin/sh
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: openvswitch-vtep
|
|
# Required-Start: $network $named $remote_fs $syslog
|
|
# Required-Stop: $remote_fs
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Open vSwitch VTEP emulator
|
|
# Description: Initializes the Open vSwitch VTEP emulator
|
|
### END INIT INFO
|
|
|
|
SYSTEMCTL_SKIP_REDIRECT=yes
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
# Include defaults if available
|
|
default=/etc/default/openvswitch-vtep
|
|
if [ -f $default ] ; then
|
|
. $default
|
|
fi
|
|
|
|
start () {
|
|
if [ "$ENABLE_OVS_VTEP" = "false" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
update-rc.d -f openvswitch-switch remove >/dev/null 2>&1
|
|
/etc/init.d/openvswitch-switch stop
|
|
|
|
mkdir -p "/var/run/openvswitch"
|
|
|
|
if [ ! -e "/etc/openvswitch/conf.db" ]; then
|
|
ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
|
|
fi
|
|
|
|
if [ ! -e "/etc/openvswitch/vtep.db" ]; then
|
|
ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema
|
|
fi
|
|
|
|
if [ ! -e "/etc/openvswitch/ovsclient-cert.pem" ]; then
|
|
export RANDFILE="/root/.rnd"
|
|
cd /etc/openvswitch && ovs-pki req ovsclient && ovs-pki self-sign ovsclient
|
|
fi
|
|
|
|
ovsdb-server --pidfile --detach --log-file --remote \
|
|
punix:/var/run/openvswitch/db.sock \
|
|
--remote=db:hardware_vtep,Global,managers \
|
|
--private-key=/etc/openvswitch/ovsclient-privkey.pem \
|
|
--certificate=/etc/openvswitch/ovsclient-cert.pem \
|
|
--bootstrap-ca-cert=/etc/openvswitch/vswitchd.cacert \
|
|
/etc/openvswitch/conf.db /etc/openvswitch/vtep.db
|
|
|
|
modprobe openvswitch
|
|
|
|
ovs-vswitchd --pidfile --detach --log-file \
|
|
unix:/var/run/openvswitch/db.sock
|
|
}
|
|
|
|
stop () {
|
|
/etc/init.d/openvswitch-switch stop
|
|
}
|
|
|
|
case $1 in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|force-reload)
|
|
stop
|
|
start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|