Jump to content
  • [6.12.4] /ETC/RC.D/RC.DOCKER IGNORES ADDITIONAL CONTAINER NETWORKS AND CAN'T AUTO-START AFFECTED CONTAINERS (AGAIN)


    user12345678
    • Minor

    Greetings.

     

    This issue was previously reported:

     

     

    And subsequently fixed in 6.11.1:

     

     

    On 10/6/2022 at 5:56 PM, limetech said:

    Updated docker to v20.10.18 and improved networking:

    • When DHCP is used, wait for IPv4 assignment before proceeding on system startup, this avoids a possible race-condition at boot time when host access to custom networks is enabled.
    • Allow user defined networks to be reconnected at docker service start. Now all defined networks will be automatically reconnected.

     

    However it's back now in 6.12.4.

     

    Looking closely at /etc/rc.d/rc.docker, there are two issues:

     

    Issue #1 - line 296:

     

    if [[ -n $MY_NETWORK && $MY_NETWORK != $MY_NETWORK ]]; then

     

    - The point of the if-statement is to skip processing MY_NETWORK from the inner loop if it is the same as MY_NETWORK from the outer loop. This situation would represent the case where we are looking at the default network that is defined in the XML, that will be processed like normal in the outer loop, hence the attempt to skip it in the inner loop. However, someone has done some 'clean up' and re-named the variables in this inner loop the same as the ones in the outer loop, specifically MY_NETWORK, which overwrites our only handle to the one in the outer loop. As-is, it just skips everything because MY_NETWORK is always equal to MY_NETWORK. In order to fix this, we'll need a new variable to hold the value of MY_NETWORK before this inner loop starts and we'll need to reference that in the if-statement, like so:
     

    OUTER_LOOP_NETWORK=$MY_NETWORK #save-off the value to use in the if-statement below
    for ROW in $USER_NETWORKS; do
      ROW=(${ROW/;/ })
      MY_NETWORK=${ROW[0]}
      MY_IP=${ROW[1]/,/;}
      if [[ -n $MY_NETWORK && $MY_NETWORK != $OUTER_LOOP_NETWORK ]]; then
        LABEL=${MY_NETWORK//[0-9.]/}
        if [[ "br bond eth" =~ $LABEL && $LABEL != ${PORT:0:-1} ]]; then
          MY_NETWORK=${MY_NETWORK/$LABEL/${PORT:0:-1}}
        fi
        logger -t $(basename $0) "container $CONTAINER has an additional network that will be restored: $MY_NETWORK"
        NETRESTORE[$MY_NETWORK]="$CONTAINER,$MY_IP ${NETRESTORE[$MY_NETWORK]}"
      fi
    done

     

    Issue #2 - lines 297 - 300:

     

    LABEL=${MY_NETWORK//[0-9.]/}
    if [[ "br bond eth" =~ $LABEL && $LABEL != ${PORT:0:-1} ]]; then
      MY_NETWORK=${MY_NETWORK/$LABEL/${PORT:0:-1}}
    fi

     

    - I am guessing this has something to do with re-working network names when a user has applied the macvlan fix introduced in 6.12.4, maybe this tries to do an automatic 'translation' of sorts? It doesn't seem to 'translate' things very well, for me anyway it always just wants to change 'bond' to 'eth' so I get a bunch of 'eth2.10', 'eth2.20', etc. instead of what they should be - 'bond2.10' or 'bond2.20', etc.

     

    I have to completely comment this in order for the script to correctly restore my networks.

     

    It was obviously put here for a particular situation, but it seems to break other situations.

     

    My initial thought would be to just get rid of it entirely and let users know they will need to update their Post Arguments to correctly reference the proper network name(s), but I admit I am not aware of the exact, original reason this was put here so I may be missing something.

     

    Any thoughts?

     

    Thanks!! 

     

    • Like 1



    User Feedback

    Recommended Comments

    There are no comments to display.



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.

×
×
  • Create New...