]>
Commit | Line | Data |
---|---|---|
86d9ab04 GS |
1 | #! /bin/sh |
2 | # | |
3 | ### BEGIN INIT INFO | |
4 | # Provides: ovn-central | |
5 | # Required-Start: openvswitch-switch $remote_fs $syslog | |
6 | # Required-Stop: $remote_fs | |
7 | # Default-Start: 2 3 4 5 | |
8 | # Default-Stop: 0 1 6 | |
9 | # Short-Description: OVN central components | |
10 | # Description: ovn-central provides the userspace daemons, | |
11 | # utilities and databases for OVN that is run at a central | |
12 | # location. | |
13 | ### END INIT INFO | |
14 | ||
15 | test -x /usr/bin/ovn-northd || exit 0 | |
16 | test -x /usr/share/openvswitch/scripts/ovn-ctl || exit 0 | |
17 | ||
18 | _SYSTEMCTL_SKIP_REDIRECT=yes | |
19 | ||
20 | . /usr/share/openvswitch/scripts/ovs-lib | |
21 | if [ -e /etc/default/ovn-central ]; then | |
22 | . /etc/default/ovn-central | |
23 | fi | |
24 | ||
25 | start () { | |
26 | set /usr/share/openvswitch/scripts/ovn-ctl ${1-start_northd} | |
27 | set "$@" $OVN_CTL_OPTS | |
28 | "$@" || exit $? | |
29 | } | |
30 | ||
60bdd011 RM |
31 | stop_northd () { |
32 | set /usr/share/openvswitch/scripts/ovn-ctl ${1-stop_northd} | |
33 | set "$@" $OVN_CTL_OPTS | |
34 | "$@" || exit $? | |
35 | } | |
36 | ||
86d9ab04 GS |
37 | case $1 in |
38 | start) | |
39 | start | |
40 | ;; | |
41 | stop) | |
60bdd011 | 42 | stop_northd |
86d9ab04 GS |
43 | ;; |
44 | restart) | |
45 | start restart_northd | |
46 | ;; | |
47 | reload | force-reload) | |
48 | ;; | |
49 | status) | |
50 | /usr/share/openvswitch/scripts/ovn-ctl status_northd | |
51 | exit $? | |
52 | ;; | |
53 | *) | |
54 | echo "Usage: $0 {start|stop|reload|force-reload|restart|status}" >&2 | |
55 | exit 1 | |
56 | ;; | |
57 | esac | |
58 | ||
59 | exit 0 |