Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure ovs logging directory created before start service #1028

Merged
merged 1 commit into from
Oct 23, 2017
Merged

Ensure ovs logging directory created before start service #1028

merged 1 commit into from
Oct 23, 2017

Conversation

tiewei
Copy link
Contributor

@tiewei tiewei commented Oct 21, 2017

Without this patch, when a node first time start netplugin, and if
there wasn't netmaster started ever on the node, the ovs logging
directory will not exist and no logging will be able to be found.
This patch makes sure the ovs logging directory created before
service starts.

Signed-off-by: Wei Tie wtie@cisco.com

@@ -27,6 +28,8 @@ ovsdb-server --remote=punix:/var/run/openvswitch/db.sock --remote=db:Open_vSwitc
echo "Starting ovs-vswitchd"
ovs-vswitchd -v --pidfile --detach --log-file=/var/contiv/log/ovs-vswitchd.log -vconsole:err -vsyslog:info -vfile:info &

sleep 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait for port open?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a simple ovs-vsctl command we can run here to poll instead of sleeping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@g1rana g1rana assigned g1rana and unassigned g1rana Oct 21, 2017
@@ -27,6 +28,11 @@ ovsdb-server --remote=punix:/var/run/openvswitch/db.sock --remote=db:Open_vSwitc
echo "Starting ovs-vswitchd"
ovs-vswitchd -v --pidfile --detach --log-file=/var/contiv/log/ovs-vswitchd.log -vconsole:err -vsyslog:info -vfile:info &

while [[ $(ovsdb-client list-dbs | grep -c Open_vSwitch) -eq 0 ]] ; do
echo "Wait for ovsdb started"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to "Waiting for ovsdb to start"?

Also, should we fail after N attempts? We do that in other places where we poll for readiness

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Without this patch, when a node first time start netplugin, and if
there wasn't netmaster started ever on the node, the ovs logging
directory will not exist and no logging will be able to be found.
This patch makes sure the ovs logging directory created before
service starts.
Also added a wait step before ovsdb ready, and logging level.
changes the indentation to 4 spaces and make codes more readable

Signed-off-by: Wei Tie <wtie@cisco.com>
Copy link
Contributor

@dseevr dseevr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

@dseevr
Copy link
Contributor

dseevr commented Oct 23, 2017

build pr

Copy link
Member

@vhosakot vhosakot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chrisplo chrisplo merged commit c43b0e9 into contiv:master Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants