Dan Kenigsberg has uploaded a new change for review.
Change subject: retire netstat ......................................................................
retire netstat
net-tools is not installed on F18 by default, and was obsoleted by iproute a decade ago.
Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Signed-off-by: Dan Kenigsberg danken@redhat.com --- M vdsm/vdsmd.init.in 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/9651/1
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in index 4446ecf..c2fb49c 100755 --- a/vdsm/vdsmd.init.in +++ b/vdsm/vdsmd.init.in @@ -62,7 +62,7 @@ return 1 fi MANAGEMENT_IP=`$GETCONFITEM $CONF_FILE addresses management_ip 0.0.0.0` - netstat -ntl | grep -q "$MANAGEMENT_IP:$MANAGEMENT_PORT" + ss -ntl | grep -q "$MANAGEMENT_IP:$MANAGEMENT_PORT" RETVAL=$? if [ "$RETVAL" -eq 0 ]; then log_failure_msg "$prog: port $MANAGEMENT_PORT already bound"
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com
Igor Lvovsky has posted comments on this change.
Change subject: retire netstat ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com
Alon Bar-Lev has posted comments on this change.
Change subject: retire netstat ......................................................................
Patch Set 1: I would prefer that you didn't submit this
Although it is correct, I don't like pulling netstat output in and tool to know if port is free.
We can fail for 100000 other reason to start the daemon, so why check only that? I suggest removing this check.
But if we want to keep it, a simple bind using 'python -c "import socket; ..."' is more appropriate, so we do not parse anything and get definite result.
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: retire netstat ......................................................................
Patch Set 1:
yeah,
python -c "from socket import socket;socket().bind(('$MANAGEMENT_IP', $MANAGEMENT_PORT))" > /dev/null 2>&1
would have worked fine, but now that we have systemd, there is no much point in trying to give an immediate output to the admin doing `service vdsmd start` - he would have to read the logs anyways.
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com
Alon Bar-Lev has posted comments on this change.
Change subject: vdsmd.init: drop check_port_taken ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: vdsmd.init: drop check_port_taken ......................................................................
Patch Set 2: Verified
if port 54321 is already taken, vdsm dies while putting in its log
error: [Errno 98] Address already in use
good enough for me.
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: vdsmd.init: drop check_port_taken ......................................................................
Patch Set 2: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vdsmd.init: drop check_port_taken ......................................................................
vdsmd.init: drop check_port_taken
net-tools is not installed on F18 by default, and was obsoleted by iproute a decade ago. This is a good opportunity to drop the whole check_port_taken attempt from the daemon startup. This check is inherently raceful, it was applied only to the the xmlrpc port (even if jsonrpc is used), and is utterly unhelpful if we're using systemd (that reports error to system log, just like vdsm.log).
Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Signed-off-by: Dan Kenigsberg danken@redhat.com --- M vdsm/vdsmd.init.in 1 file changed, 0 insertions(+), 18 deletions(-)
Approvals: Alon Bar-Lev: Looks good to me, but someone else must approve Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/9651 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I8417ae3bb2f09404787cd8915984aaa6fb779e7a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com
vdsm-patches@lists.fedorahosted.org