[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15059988#comment-15059988
 ] 

ASF GitHub Bot commented on CLOUDSTACK-9181:
--------------------------------------------

Github user remibergsma commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1249#discussion_r47776850
  
    --- Diff: systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh ---
    @@ -17,21 +17,20 @@
     # under the License.
     
     STATUS=UNKNOWN
    -INTERFACE=eth1
     ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print 
$2;}' | sed -e 's/[,\"]//g')
    -if [ $ROUTER_TYPE = "router" ]
    +if [ "$ROUTER_TYPE" = "router" ]
     then
        ROUTER_STATE=$(ip addr | grep eth0 | grep inet | wc -l | xargs bash -c  
'if [ $0 == 2 ]; then echo "MASTER"; else echo "BACKUP"; fi')
        STATUS=$ROUTER_STATE
     else
    -   ROUTER_STATE=$(ip addr | grep $INTERFACE | grep state | awk '{print 
$9;}')
    -   if [ $ROUTER_STATE = "UP" ]
    +   ROUTER_STATE=$(ip addr | grep eth1 | grep state | awk '{print $9;}')
    --- End diff --
    
    Split the commits and added a note.


> 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)

Reply via email to