From: Numan Siddique
Until now, OVN uses the openvswitch rundirs (rundir, logdir, etcdir).
The commit [1] changed the package name from openvswitch to ovn, but
it didn't take into the account the effects of it. When "make install"
is run ovn-ctl utility is copied to /usr/local/share/ovn/scripts folder.
ovn-ctl depends on 'ovs-lib' and it is not present in this scripts foler.
Because of which we cannot start OVN services using ovn-ctl.
This patch addresses all these issues. It changes the rundir to
ovn specific ones. (i.e /usr/local/var/run/ovn, /usr/local/var/log/ovn,
/usr/local/etc/ovn with default configuration).
[1] - 7795e0e28dce("Change the package name from openvswitch to ovn in
AC_INIT()")
Tested:by: Dumitru Ceara
Signed-off-by: Numan Siddique
---
Documentation/intro/install/general.rst | 30 ++--
Makefile.am | 6 +-
TODO_SPLIT.rst | 2 +
configure.ac| 34 ++--
controller/ovn-controller.c | 4 +-
lib/.gitignore | 1 +
lib/automake.mk | 21 ++-
lib/ovn-dirs.c.in | 112 +
lib/ovn-dirs.h | 35
lib/ovn-util.c | 24 ++-
lib/ovn-util.h | 1 +
m4/{openvswitch.m4 => ovn.m4} | 60 +++
northd/ovn-northd.c | 9 +-
tests/ovs-macros.at | 1 +
tutorial/ovs-sandbox| 1 +
utilities/automake.mk | 5 +
utilities/ovn-ctl | 71 +
utilities/ovn-ctl.8.xml | 12 +-
utilities/ovn-lib.in| 204
19 files changed, 520 insertions(+), 113 deletions(-)
create mode 100644 lib/ovn-dirs.c.in
create mode 100644 lib/ovn-dirs.h
rename m4/{openvswitch.m4 => ovn.m4} (94%)
create mode 100644 utilities/ovn-lib.in
diff --git a/Documentation/intro/install/general.rst
b/Documentation/intro/install/general.rst
index 01d545da2..9afd7f799 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -159,17 +159,17 @@ For example::
If you have built Open vSwitch in a separate directory, then you
need to provide that path in the option - --with-ovs-build.
-By default all files are installed under ``/usr/local``. OVN and Open vSwitch
-also expects to find its database in ``/usr/local/etc/openvswitch`` by default.
+By default all files are installed under ``/usr/local``. OVN expects to find
+its database in ``/usr/local/etc/ovn`` by default.
If you want to install all files into, e.g., ``/usr`` and ``/var`` instead of
-``/usr/local`` and ``/usr/local/var`` and expect to use ``/etc/openvswitch`` as
+``/usr/local`` and ``/usr/local/var`` and expect to use ``/etc/ovn`` as
the default database directory, add options as shown here::
$ ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
.. note::
- Open vSwitch and OVN installed with packages like .rpm (e.g. via
+ OVN installed with packages like .rpm (e.g. via
``yum install`` or ``rpm -ivh``) and .deb (e.g. via
``apt-get install`` or ``dpkg -i``) use the above configure options.
@@ -338,9 +338,13 @@ and stopping ovn-northd, ovn-controller and ovsdb-servers.
After installation,
the daemons can be started by using the ovn-ctl utility. This will take care
to setup initial conditions, and start the daemons in the correct order.
The ovn-ctl utility is located in '$(pkgdatadir)/scripts', and defaults to
-'/usr/local/share/openvswitch/scripts'. An example after install might be::
+'/usr/local/share/ovn/scripts'. ovn-ctl utility requires the 'ovs-lib'
+helper shell script which is present in '/usr/local/share/openvswitch/scripts'.
+So invoking ovn-ctl as "./ovn-ctl" will fail.
-$ export PATH=$PATH:/usr/local/share/openvswitch/scripts
+An example after install might be::
+
+$ export PATH=$PATH:/usr/local/share/ovn/scripts
$ ovn-ctl start_northd
$ ovn-ctl start_controller
@@ -350,7 +354,7 @@ Starting OVN Central services
OVN central services includes ovn-northd, Northbound and
Southbound ovsdb-server.
-$ export PATH=$PATH:/usr/local/share/openvswitch/scripts
+$ export PATH=$PATH:/usr/local/share/ovn/scripts
$ ovn-ctl start_northd
Refer to ovn-ctl(8) for more information and the supported options.
@@ -360,23 +364,23 @@ Before starting ovn-northd you need to start OVN
Northbound and Southbound
ovsdb-servers. Before ovsdb-servers can be started,
configure the Northbound and Southbound databases::
- $ mkdir -p /usr/local/etc/openvswitch
- $ ovsdb-tool create /usr/local/etc/openvswitch/ovnnb_db.db \
+ $ mkdir -p /usr/local/etc/ovn
+ $ ovsdb-tool create /usr/local/etc/ovn/ovnnb_db.db \
ovn-nb.ovsschema
- $ ovsdb-tool create /usr/local/etc/openvswitch/ovnsb_db.db \
+ $