Skip to content

Commit

Permalink
ovs-sim, ovs-sandbox: Turn off logging to syslog.
Browse files Browse the repository at this point in the history
There's no value in having these testing tools log to syslog.  It just
pollutes the system log.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Justin Pettit <[email protected]>
  • Loading branch information
blp committed May 25, 2018
1 parent 59cff95 commit 2128f9b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
12 changes: 7 additions & 5 deletions tutorial/ovs-sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ if $ovn; then
done
fi
fi
rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \
rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file -vsyslog:off \
--remote=punix:"$sandbox"/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
$ovsdb_server_args
Expand Down Expand Up @@ -428,6 +428,7 @@ if $ovn; then
local i=$1; shift
rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir \
--pidfile=$db$i.pid -vconsole:off --log-file=$db$i.log \
-vsyslog:off \
--remote=db:$schema_name,${DB}_Global,connections \
--private-key=db:$schema_name,SSL,private_key \
--certificate=db:$schema_name,SSL,certificate \
Expand Down Expand Up @@ -500,7 +501,7 @@ fi
run ovs-vsctl --no-wait -- init

# Start ovs-vswitchd.
rungdb $gdb_vswitchd $gdb_vswitchd_ex ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file \
rungdb $gdb_vswitchd $gdb_vswitchd_ex ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file -vsyslog:off \
--enable-dummy=$dummy -vvconn -vnetdev_dummy

if $ovn; then
Expand Down Expand Up @@ -530,17 +531,18 @@ if $ovn; then
for i in $(seq $n_northds); do
rungdb $gdb_ovn_northd $gdb_ovn_northd_ex ovn-northd --detach \
--no-chdir --pidfile=ovn-northd$i.pid -vconsole:off \
--log-file=ovn-northd$i.log \
--log-file=ovn-northd$i.log -vsyslog:off \
--ovnsb-db="$OVN_SB_DB" --ovnnb-db="$OVN_NB_DB"
done
for i in $(seq $n_controllers); do
rungdb $gdb_ovn_controller $gdb_ovn_controller_ex ovn-controller \
$OVN_CTRLR_PKI --detach --no-chdir \
$OVN_CTRLR_PKI --detach --no-chdir -vsyslog:off \
--pidfile=ovn-controller$i.pid -vconsole:off --log-file
done
rungdb $gdb_ovn_controller_vtep $gdb_ovn_controller_vtep_ex \
ovn-controller-vtep --detach --no-chdir --pidfile -vconsole:off \
$OVN_CTRLR_PKI --log-file --ovnsb-db=unix:"$sandbox"/ovnsb_db.sock
$OVN_CTRLR_PKI --log-file -vsyslog:off \
--ovnsb-db=unix:"$sandbox"/ovnsb_db.sock
fi

cat <<EOF
Expand Down
23 changes: 14 additions & 9 deletions utilities/ovs-sim.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ sim_setvars() {
}
export -f sim_setvars

ovs-vsctl () { command ovs-vsctl -vsyslog:off "$@"; }; export -f ovs-vsctl
ovs-nbctl () { command ovs-nbctl -vsyslog:off "$@"; }; export -f ovs-nbctl
ovs-sbctl () { command ovs-sbctl -vsyslog:off "$@"; }; export -f ovs-sbctl
vtep-ctl () { command vtep-ctl -vsyslog:off "$@"; }; export -f vtep-ctl

as() {
case $# in
0)
Expand Down Expand Up @@ -160,18 +165,18 @@ EOF
# Create sandbox.
mkdir "$sim_base"/$1 || return 1

daemon_opts="--detach --no-chdir --pidfile -vconsole:off --log-file"
daemon_opts="--detach --no-chdir --pidfile -vconsole:off -vsyslog:off --log-file"

# Create database and start ovsdb-server.
touch $sim_base/$1/.conf.db.~lock~
as $1 ovsdb-tool create $sim_base/$1/conf.db "$sim_srcdir/vswitchd/vswitch.ovsschema"
as $1 ovsdb-server $daemon_opts --remote=punix:"$sim_base"/$1/db.sock
as $1 ovsdb-server --remote=punix:"$sim_base"/$1/db.sock $daemon_opts

# Initialize database.
as $1 ovs-vsctl --no-wait -- init

# Start ovs-vswitchd.
as $1 ovs-vswitchd $daemon_opts --enable-dummy=system -vvconn -vnetdev_dummy
as $1 ovs-vswitchd --enable-dummy=system -vvconn -vnetdev_dummy $daemon_opts
}
export -f sim_add

Expand Down Expand Up @@ -252,12 +257,12 @@ EOF
exit 1
fi

daemon_opts="--detach --no-chdir --pidfile -vconsole:off --log-file"
daemon_opts="--detach --no-chdir --pidfile -vconsole:off -vsyslog:off --log-file"
for db in ovn-sb ovn-nb; do
mkdir "$sim_base"/$db
touch "$sim_base"/$db/.$db.db.~lock~
as $db ovsdb-tool create "$sim_base"/$db/$db.db "$sim_srcdir"/ovn/$db.ovsschema
as $db ovsdb-server $daemon_opts --remote=punix:"$sim_base"/$db/$db.sock "$sim_base"/$db/$db.db
as $db ovsdb-server --remote=punix:"$sim_base"/$db/$db.sock "$sim_base"/$db/$db.db $daemon_opts
done

OVN_NB_DB=unix:$sim_base/ovn-nb/ovn-nb.sock; export OVN_NB_DB
Expand All @@ -267,9 +272,8 @@ EOF
ovn-sbctl init

mkdir "$sim_base"/northd
as northd ovn-northd $daemon_opts \
--ovnnb-db="$OVN_NB_DB" \
--ovnsb-db="$OVN_SB_DB"
as northd ovn-northd --ovnnb-db="$OVN_NB_DB" --ovnsb-db="$OVN_SB_DB" \
$daemon_opts
}
export -f ovn_start

Expand Down Expand Up @@ -304,7 +308,7 @@ EOF
-- set Open_vSwitch . external-ids:ovn-encap-ip=$ip\
-- add-br br-int \
-- set bridge br-int fail-mode=secure other-config:disable-in-band=true
ovn-controller --detach --no-chdir --pidfile -vconsole:off --log-file
ovn-controller --detach --no-chdir --pidfile -vconsole:off -vsyslog:off --log-file
}
export -f ovn_attach

Expand Down Expand Up @@ -347,6 +351,7 @@ rc='
EOF
'

set +e
status=0; bash --rcfile <(echo "$rc") || status=$?

if $interactive; then
Expand Down

0 comments on commit 2128f9b

Please sign in to comment.