Commit 3d7459c 1 parent 9dbb016 commit 3d7459c Copy full SHA for 3d7459c
File tree 1 file changed +31
-1
lines changed
1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,37 @@ function waitplatform() {
19
19
}
20
20
21
21
function stopplatform1() {
22
- :
22
+ if ! docker top gbsyncd$DEV | grep -q /usr/bin/syncd; then
23
+ debug " syncd process in container gbsyncd$DEV is not running"
24
+ return
25
+ fi
26
+
27
+ # Invoke platform specific pre shutdown routine.
28
+ PLATFORM=` $SONIC_DB_CLI CONFIG_DB hget ' DEVICE_METADATA|localhost' platform`
29
+ PLATFORM_PRE_SHUTDOWN=" /usr/share/sonic/device/$PLATFORM /plugins/gbsyncd_request_pre_shutdown"
30
+ [ -f $PLATFORM_PRE_SHUTDOWN ] && \
31
+ /usr/bin/docker exec -i gbsyncd$DEV /usr/share/sonic/platform/plugins/gbsyncd_request_pre_shutdown --${TYPE}
32
+
33
+ debug " ${TYPE} shutdown syncd process in container gbsyncd$DEV ..."
34
+ /usr/bin/docker exec -i gbsyncd$DEV /usr/bin/syncd_request_shutdown -g 1 -x /usr/share/sonic/hwsku/context_config.json --${TYPE}
35
+
36
+ # wait until syncd quits gracefully or force syncd to exit after
37
+ # waiting for 20 seconds
38
+ start_in_secs=${SECONDS}
39
+ end_in_secs=${SECONDS}
40
+ timer_threshold=20
41
+ while docker top gbsyncd$DEV | grep -q /usr/bin/syncd \
42
+ && [[ $(( end_in_secs - start_in_secs)) -le $timer_threshold ]]; do
43
+ sleep 0.1
44
+ end_in_secs=${SECONDS}
45
+ done
46
+
47
+ if [[ $(( end_in_secs - start_in_secs)) -gt $timer_threshold ]]; then
48
+ debug " syncd process in container gbsyncd$DEV did not exit gracefully"
49
+ fi
50
+
51
+ /usr/bin/docker exec -i gbsyncd$DEV /bin/sync
52
+ debug " Finished ${TYPE} shutdown syncd process in container gbsyncd$DEV ..."
23
53
}
24
54
25
55
function stopplatform2() {
You can’t perform that action at this time.
0 commit comments