3
## Install Open vSwitch (2.0.0). This file is translated from
4
## cookbook/openvswitch/recipes/default
7
sudo apt-get -y install build-essential \
13
python-twisted-conch \
19
sudo mkdir -p /opt/openvswitch
20
sudo chmod 00755 /opt/openvswitch
21
sudo chown root:root /opt/openvswitch
23
sudo mkdir -p /etc/openvswitch
24
sudo chmod 00755 /etc/openvswitch
25
sudo chown root:root /etc/openvswitch
27
sudo chmod a+w /opt/openvswitch
29
wget http://openvswitch.org/releases/openvswitch-2.0.0.tar.gz
30
tar xzvf openvswitch-2.0.0.tar.gz
31
mv openvswitch-2.0.0 openvswitch
33
./configure --with-linux=/lib/modules/`uname -r`/build \
34
--prefix=/usr --localstatedir=/var # default to these libraries
37
sudo make modules_install
38
sudo ovsdb-tool create /etc/openvswitch/conf.db \
39
vswitchd/vswitch.ovsschema
40
sudo /usr/bin/ovs-vsctl --no-wait init
42
echo "start on (filesystem and net-device-up)
43
stop on runlevel [016]
45
# Automatically restart process if crashed
48
# Essentially lets upstart know the process will detach itself to the background
52
/sbin/modprobe openvswitch
54
mkdir -p /var/run/openvswitch/
58
exec /usr/sbin/ovsdb-server /etc/openvswitch/conf.db \\
59
--remote=punix:/var/run/openvswitch/db.sock \\
60
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \\
61
--private-key=db:Open_vSwitch,SSL,private_key \\
62
--certificate=db:Open_vSwitch,SSL,certificate \\
63
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \\
67
# seems main script only allows one daemon, so we move another
68
# daemon(s) to post-start and pre-stop
70
exec /usr/sbin/ovs-vswitchd --pidfile --detach
74
exec killall -9 ovs-vswitchd
78
/sbin/rmmod openvswitch
80
" | sudo tee /etc/init/openvswitch.conf
81
sudo chmod 00755 /etc/init/openvswitch.conf
82
sudo chown root:root /etc/init/openvswitch.conf
84
sudo service openvswitch start