Skip to content

Commit

Permalink
Define localstatedir for ovs compilation
Browse files Browse the repository at this point in the history
By default localstatedir is PREFIX/var, which means logs are placed to
/usr/var/log/openvswitch directory. This patch redefines explicitly to
put the log files into /var/log/openvswitch, also /var/run/openvswitch
will be correctly used for pid file.

Change-Id: I1a02e8f33e745da82addfbf34efd487adf726e71
Closes-Bug: 1566569
  • Loading branch information
cubeek committed Apr 6, 2016
1 parent 3791469 commit 92af311
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions devstack/lib/ovs
Expand Up @@ -35,16 +35,22 @@ function load_module {
# Accepts two parameters:
# - first one is True, modules are built and installed.
# - second optional parameter defines prefix for ovs compilation
# - third optional parameter defines localstatedir for ovs single machine runtime
# Env variables OVS_REPO_NAME, OVS_REPO and OVS_BRANCH must be set
function compile_ovs {
local _pwd=$PWD
local build_modules=${1:-True}
local prefix=$2
local localstatedir=$3

if [ -n "$prefix" ]; then
prefix="--prefix=$prefix"
fi

if [ -n "$localstatedir" ]; then
localstatedir="--localstatedir=$localstatedir"
fi

cd $DEST
if [ ! -d $OVS_REPO_NAME ] ; then
git clone $OVS_REPO
Expand All @@ -67,9 +73,9 @@ function compile_ovs {
fi
if [ ! -f config.status ] || [ configure -nt config.status ] ; then
if [[ "$build_modules" == "True" ]]; then
./configure $prefix --with-linux=/lib/modules/$(uname -r)/build
./configure $prefix $localstatedir --with-linux=/lib/modules/$(uname -r)/build
else
./configure $prefix
./configure $prefix $localstatedir
fi
fi
make -j$[$(nproc) + 1]
Expand Down
2 changes: 1 addition & 1 deletion neutron/tests/contrib/gate_hook.sh
Expand Up @@ -33,7 +33,7 @@ then
uninstall_package $package
fi
done
compile_ovs True /usr
compile_ovs True /usr /var
start_new_ovs
fi

Expand Down

0 comments on commit 92af311

Please sign in to comment.