-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[docker-teamd]: Manage teamd and teamsyncd processes with sup…
…ervisor (#1137)" (#1156) This reverts commit a6edef2. The reason to revert this commit is that it breaks the current nightly test as no port channel interfaces are get created after boot. teamd failed to start and complained about 'Cannot allocate memory' possibly due to nlmsg_alloc function failure. Will revert this commit to investigate it further before moving to supervisor. Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
- Loading branch information
Shuotian Cheng
authored
Nov 16, 2017
1 parent
d376506
commit c93c008
Showing
10 changed files
with
64 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
TEAMD_CONF_PATH=/etc/teamd | ||
|
||
rm -rf $TEAMD_CONF_PATH | ||
mkdir -p $TEAMD_CONF_PATH | ||
|
||
SONIC_ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type) | ||
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') | ||
|
||
# Align last byte | ||
if [ "$SONIC_ASIC_TYPE" == "mellanox" -o "$SONIC_ASIC_TYPE" == "centec" ]; then | ||
last_byte=$(python -c "print '$MAC_ADDRESS'[-2:]") | ||
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) & 0b11000000), '02x')") # put mask and take away the 0x prefix | ||
MAC_ADDRESS=$(python -c "print '$MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC | ||
fi | ||
|
||
for pc in `sonic-cfggen -d -v "PORTCHANNEL.keys() | join(' ') if PORTCHANNEL"`; do | ||
sonic-cfggen -d -a '{"pc":"'$pc'","hwaddr":"'$MAC_ADDRESS'"}' -t /usr/share/sonic/templates/teamd.j2 > $TEAMD_CONF_PATH/$pc.conf | ||
# bring down all member ports before starting teamd | ||
for member in $(sonic-cfggen -d -v "PORTCHANNEL['$pc']['members'] | join(' ')" ); do | ||
if [ -L /sys/class/net/$member ]; then | ||
ip link set $member down | ||
fi | ||
done | ||
done | ||
|
||
mkdir -p /var/sonic | ||
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status | ||
|
||
rm -f /var/run/rsyslogd.pid | ||
|
||
supervisorctl start rsyslogd | ||
|
||
supervisorctl start teamd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
TEAMD_CONF_FILE=$1 | ||
TEAMD_CONF_PATH=/etc/teamd | ||
|
||
function start_app { | ||
rm -f /var/run/teamd/* | ||
if [ "$(ls -A $TEAMD_CONF_PATH)" ]; then | ||
for f in $TEAMD_CONF_PATH/*; do | ||
teamd -f $f -d | ||
done | ||
fi | ||
teamsyncd & | ||
} | ||
|
||
function clean_up { | ||
teamd -f $TEAMD_CONF_FILE -k | ||
exit $? | ||
if [ "$(ls -A $TEAMD_CONF_PATH)" ]; then | ||
for f in $TEAMD_CONF_PATH/*; do | ||
teamd -f $f -k | ||
done | ||
fi | ||
pkill -9 teamsyncd | ||
exit | ||
} | ||
|
||
trap clean_up SIGTERM SIGKILL | ||
|
||
teamd -f $TEAMD_CONF_FILE & | ||
TEAMD_PID=$! | ||
wait $TEAMD_PID | ||
exit $? | ||
start_app | ||
read |
64 changes: 0 additions & 64 deletions
64
src/sonic-config-engine/tests/sample_output/docker-teamd.supervisord.conf
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/sonic-config-engine/tests/sample_output/wait_for_intf.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters