File tree 2 files changed +21
-4
lines changed
2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 11
11
echo $HOSTNAME > /etc/hostname
12
12
hostname -F /etc/hostname
13
13
14
+ # Don't update the /etc/hosts if hostname is not changed
15
+ # This is to prevent intermittent redis_chassis.server reachability issue
16
+ if [ $CURRENT_HOSTNAME == $HOSTNAME ] ; then
17
+ exit 0
18
+ fi
19
+
14
20
# Remove the old hostname entry from hosts file.
15
21
# But, 'localhost' entry is used by multiple applications. Don't remove it altogether.
16
22
# Edit contents of /etc/hosts and put in /etc/hosts.new
17
- if [ $CURRENT_HOSTNAME != " localhost" ] || [ $CURRENT_HOSTNAME == $HOSTNAME ] ; then
23
+ if [ $CURRENT_HOSTNAME != " localhost" ] ; then
18
24
sed " /\s$CURRENT_HOSTNAME $/d" /etc/hosts > /etc/hosts.new
19
25
else
20
26
cp -f /etc/hosts /etc/hosts.new
Original file line number Diff line number Diff line change @@ -132,12 +132,23 @@ function clean_up_chassis_db_tables()
132
132
return
133
133
fi
134
134
135
- if [[ ! ( $( $SONIC_DB_CLI CHASSIS_APP_DB PING | grep -c True) -gt 0) ]]; then
136
- return
137
- fi
135
+ until [[ $( $SONIC_DB_CLI CHASSIS_APP_DB PING | grep -c True) -gt 0 ]]; do
136
+ sleep 1
137
+ done
138
138
139
139
lc=` $SONIC_DB_CLI CONFIG_DB hget ' DEVICE_METADATA|localhost' ' hostname' `
140
+ until [[ -n " ${lc} " ]]; do
141
+ lc=` $SONIC_DB_CLI CONFIG_DB hget ' DEVICE_METADATA|localhost' ' hostname' `
142
+ sleep 1
143
+ done
144
+ debug " Chassis db clean up for ${SERVICE} $DEV . hostname=$lc "
145
+
140
146
asic=` $SONIC_DB_CLI CONFIG_DB hget ' DEVICE_METADATA|localhost' ' asic_name' `
147
+ until [[ -n " ${asic} " ]]; do
148
+ asic=` $SONIC_DB_CLI CONFIG_DB hget ' DEVICE_METADATA|localhost' ' asic_name' `
149
+ sleep 1
150
+ done
151
+ debug " Chassis db clean up for ${SERVICE} $DEV . asic=$asic "
141
152
142
153
# First, delete SYSTEM_NEIGH entries
143
154
num_neigh=` $SONIC_DB_CLI CHASSIS_APP_DB EVAL "
You can’t perform that action at this time.
0 commit comments