]>
Commit | Line | Data |
---|---|---|
5222ea5a FG |
1 | diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init |
2 | deleted file mode 100755 | |
3 | index aece780..0000000 | |
4 | --- a/debian/openvswitch-switch.init | |
5 | +++ /dev/null | |
6 | @@ -1,146 +0,0 @@ | |
7 | -#! /bin/sh | |
8 | -# | |
9 | -# Copyright (C) 2011, 2012, 2016 Nicira, Inc. | |
10 | -# | |
11 | -# Licensed under the Apache License, Version 2.0 (the "License"); | |
12 | -# you may not use this file except in compliance with the License. | |
13 | -# You may obtain a copy of the License at: | |
14 | -# | |
15 | -# http://www.apache.org/licenses/LICENSE-2.0 | |
16 | -# | |
17 | -# Unless required by applicable law or agreed to in writing, software | |
18 | -# distributed under the License is distributed on an "AS IS" BASIS, | |
19 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
20 | -# See the License for the specific language governing permissions and | |
21 | -# limitations under the License. | |
22 | -# | |
23 | -### BEGIN INIT INFO | |
24 | -# Provides: openvswitch-switch | |
25 | -# Required-Start: $network $named $remote_fs $syslog | |
26 | -# Required-Stop: $remote_fs | |
27 | -# Default-Start: 2 3 4 5 | |
28 | -# Default-Stop: 0 1 6 | |
29 | -# Short-Description: Open vSwitch switch | |
30 | -# Description: openvswitch-switch provides the userspace components and utilities for | |
31 | -# the Open vSwitch kernel-based switch. | |
32 | -### END INIT INFO | |
33 | - | |
34 | -(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0 | |
35 | - | |
36 | -_SYSTEMCTL_SKIP_REDIRECT=yes | |
37 | - | |
38 | -. /usr/share/openvswitch/scripts/ovs-lib | |
39 | -test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch | |
40 | - | |
41 | -network_interfaces () { | |
42 | - INTERFACES="/etc/network/interfaces" | |
43 | - [ -e "${INTERFACES}" ] || return | |
44 | - bridges=`ifquery --allow ovs --list` | |
45 | - [ -n "${bridges}" ] && $1 --allow=ovs ${bridges} | |
46 | -} | |
47 | - | |
48 | -load_kmod () { | |
49 | - ovs_ctl load-kmod || exit $? | |
50 | -} | |
51 | - | |
52 | -start () { | |
53 | - if ovs_ctl load-kmod; then | |
54 | - : | |
55 | - else | |
56 | - echo "Module has probably not been built for this kernel." | |
57 | - if ! test -d /usr/share/doc/openvswitch-datapath-source; then | |
58 | - echo "Install the openvswitch-datapath-source package, then read" | |
59 | - else | |
60 | - echo "For instructions, read" | |
61 | - fi | |
62 | - echo "/usr/share/doc/openvswitch-datapath-source/README.Debian" | |
63 | - | |
64 | - if test X"$OVS_MISSING_KMOD_OK" = Xyes; then | |
65 | - # We're being invoked by the package postinst. Do not | |
66 | - # fail package installation just because the kernel module | |
67 | - # is not available. | |
68 | - exit 0 | |
69 | - fi | |
70 | - fi | |
71 | - set ovs_ctl ${1-start} --system-id=random | |
72 | - if test X"$FORCE_COREFILES" != X; then | |
73 | - set "$@" --force-corefiles="$FORCE_COREFILES" | |
74 | - fi | |
75 | - set "$@" $OVS_CTL_OPTS | |
76 | - "$@" || exit $? | |
77 | - if [ "$2" = "start" ] && [ "$READ_INTERFACES" != "no" ]; then | |
78 | - network_interfaces ifup | |
79 | - fi | |
80 | -} | |
81 | - | |
82 | -stop () { | |
83 | - [ "$READ_INTERFACES" != "no" ] && network_interfaces ifdown | |
84 | - ovs_ctl stop | |
85 | -} | |
86 | - | |
87 | -restart () { | |
88 | - # OVS_FORCE_RELOAD_KMOD can be set by package postinst script. | |
89 | - if [ "$1" = "--save-flows=yes" ] || \ | |
90 | - [ "${OVS_FORCE_RELOAD_KMOD}" = "no" ]; then | |
91 | - start restart | |
92 | - elif [ "${OVS_FORCE_RELOAD_KMOD}" = "yes" ]; then | |
93 | - depmod -a | |
94 | - | |
95 | - if [ -e /sys/module/openvswitch ]; then | |
96 | - LOADED_SRCVERSION=`cat /sys/module/openvswitch/srcversion \ | |
97 | - 2>/dev/null` | |
98 | - LOADED_VERSION=`cat /sys/module/openvswitch/version \ | |
99 | - 2>/dev/null` | |
100 | - fi | |
101 | - SRCVERSION=`modinfo -F srcversion openvswitch 2>/dev/null` | |
102 | - VERSION=`modinfo -F version openvswitch 2>/dev/null` | |
103 | - | |
104 | - ovs_ctl_log "Package upgrading:\n"\ | |
105 | - "Loaded version: ${LOADED_VERSION} ${LOADED_SRCVERSION}.\n"\ | |
106 | - "Version on disk: ${VERSION} ${SRCVERSION}." | |
107 | - | |
108 | - # If the kernel module was previously loaded and it is different than | |
109 | - # the kernel module on disk, then do a 'force-reload-kmod'. | |
110 | - if [ -n "${LOADED_SRCVERSION}" ] && [ -n "${SRCVERSION}" ] && \ | |
111 | - [ "${SRCVERSION}" != "${LOADED_SRCVERSION}" ]; then | |
112 | - start force-reload-kmod | |
113 | - else | |
114 | - start restart | |
115 | - fi | |
116 | - else | |
117 | - READ_INTERFACES="no" stop | |
118 | - READ_INTERFACES="no" start | |
119 | - fi | |
120 | -} | |
121 | - | |
122 | -case $1 in | |
123 | - start) | |
124 | - start | |
125 | - ;; | |
126 | - stop | force-stop) | |
127 | - stop | |
128 | - ;; | |
129 | - reload | force-reload) | |
130 | - # The OVS daemons keep up-to-date. | |
131 | - ;; | |
132 | - restart) | |
133 | - shift | |
134 | - restart "$@" | |
135 | - ;; | |
136 | - status) | |
137 | - ovs_ctl status | |
138 | - exit $? | |
139 | - ;; | |
140 | - force-reload-kmod) | |
141 | - start force-reload-kmod | |
142 | - ;; | |
143 | - load-kmod) | |
144 | - load_kmod | |
145 | - ;; | |
146 | - *) | |
147 | - echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2 | |
148 | - exit 1 | |
149 | - ;; | |
150 | -esac | |
151 | - | |
152 | -exit 0 |