Return-Path: X-Original-To: apmail-cloudstack-issues-archive@www.apache.org Delivered-To: apmail-cloudstack-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0ACBD18376 for ; Mon, 28 Dec 2015 16:08:50 +0000 (UTC) Received: (qmail 84701 invoked by uid 500); 28 Dec 2015 16:08:49 -0000 Delivered-To: apmail-cloudstack-issues-archive@cloudstack.apache.org Received: (qmail 84670 invoked by uid 500); 28 Dec 2015 16:08:49 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 84660 invoked by uid 500); 28 Dec 2015 16:08:49 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 84657 invoked by uid 99); 28 Dec 2015 16:08:49 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Dec 2015 16:08:49 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8BBFB2C14F9 for ; Mon, 28 Dec 2015 16:08:49 +0000 (UTC) Date: Mon, 28 Dec 2015 16:08:49 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-9181) Syntax error in checkrouter.sh when interface is missing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15072853#comment-15072853 ] ASF GitHub Bot commented on CLOUDSTACK-9181: -------------------------------------------- GitHub user remibergsma opened a pull request: https://github.com/apache/cloudstack/pull/1295 CLOUDSTACK-9181 Prevent syntax error in checkrouter.sh Added quotes to prevent syntax errors in weird situations. Error seen in mgt server: ``` 2015-12-15 14:30:32,371 DEBUG [c.c.a.m.AgentManagerImpl] (RedundantRouterStatusMonitor-7:ctx-0dd8ef3e) Details from executing class com.cloud.agent.api.CheckRouterCommand: Status: UNKNOWN /opt/cloud/bin/checkrouter.sh: line 28: [: =: unary operator expected /opt/cloud/bin/checkrouter.sh: line 31: [: =: unary operator expected ``` Cause: ``` root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh ./checkrouter.sh: line 28: [: =: unary operator expected ./checkrouter.sh: line 31: [: =: unary operator expected Status: UNKNOWN ``` Somehow a nic was missing. After fix the script can handle this: ``` root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh Status: UNKNOWN ``` The other states are also reported fine: ``` root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh Status: MASTER ``` ``` root@r-1192-VM:/opt/cloud/bin# ./checkrouter.sh Status: BACKUP ``` While at it, I also removed the INTERFACES variable/constant as it was only used once and hardcoded the second time. Now both are hardcoded and easier to read. This is the same as PR #1249 except it is against `4.7`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/remibergsma/cloudstack fix-checkrouter-script47 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1295.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1295 ---- commit 525949e027d89a5c8ef0d1b7012446bb652be659 Author: Remi Bergsma Date: 2015-12-16T10:27:26Z CLOUDSTACK-9181 Prevent syntax error in checkrouter.sh commit 8fb677027dc48d034fa9440b125c6bae084266d4 Author: Remi Bergsma Date: 2015-12-16T13:45:57Z make both check lines consistent No need to make a variable, use it on one place and hardcode it on another. ---- > Syntax error in checkrouter.sh when interface is missing > -------------------------------------------------------- > > Key: CLOUDSTACK-9181 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9181 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the default.) > Components: Virtual Router > Affects Versions: 4.7.0 > Reporter: Remi Bergsma > > Error seen in mgt server: > 2015-12-15 14:30:32,371 DEBUG [c.c.a.m.AgentManagerImpl] (RedundantRouterStatusMonitor-7:ctx-0dd8ef3e) Details from executing class com.cloud.agent.api.CheckRouterCommand: Status: UNKNOWN > /opt/cloud/bin/checkrouter.sh: line 28: [: =: unary operator expected > /opt/cloud/bin/checkrouter.sh: line 31: [: =: unary operator expected > root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh > ./checkrouter.sh: line 28: [: =: unary operator expected > ./checkrouter.sh: line 31: [: =: unary operator expected > Status: UNKNOWN > Somehow a nic was missing. > After fix the script can handle this: > root@r-1191-VM:/opt/cloud/bin# ./checkrouter.sh > Status: UNKNOWN -- This message was sent by Atlassian JIRA (v6.3.4#6332)