[fast-reboot]: Save fast-reboot state into the db (#3741)
Put a flag for fast-reboot to the db using EXPIRE feature. Using this flag in other part of SONiC to start in Fast-reboot mode. If we reload a config, the state in the db will be removed.
This commit is contained in:
parent
d688c267b5
commit
74b45be487
@ -47,7 +47,13 @@ RUN apt-get update && \
|
||||
vim-tiny \
|
||||
# Install dependencies of supervisor
|
||||
python-pkg-resources \
|
||||
python-meld3
|
||||
python-meld3 \
|
||||
# dependencies of redis-tools
|
||||
libatomic1 \
|
||||
libjemalloc1 \
|
||||
liblua5.1-0 \
|
||||
lua-bitop \
|
||||
lua-cjson
|
||||
|
||||
{% if CONFIGURED_ARCH == "armhf" %}
|
||||
# ip and ifconfig utility missing in docker for armhf
|
||||
|
@ -18,13 +18,6 @@ RUN apt-get update && \
|
||||
iproute2 \
|
||||
ndisc6 \
|
||||
tcpdump \
|
||||
# Install redis-tools dependencies
|
||||
# TODO: implicitly install dependencies
|
||||
libatomic1 \
|
||||
libjemalloc1 \
|
||||
liblua5.1-0 \
|
||||
lua-bitop \
|
||||
lua-cjson \
|
||||
libelf1 \
|
||||
libmnl0 \
|
||||
bridge-utils
|
||||
|
@ -11,14 +11,7 @@ RUN apt-get update && \
|
||||
apt-get install -f -y \
|
||||
libdbus-1-3 \
|
||||
libdaemon0 \
|
||||
libjansson4 \
|
||||
# Install redis-tools dependencies
|
||||
# TODO: implicitly install dependencies
|
||||
libatomic1 \
|
||||
libjemalloc1 \
|
||||
liblua5.1-0 \
|
||||
lua-bitop \
|
||||
lua-cjson
|
||||
libjansson4
|
||||
|
||||
{% if docker_sonic_telemetry_debs.strip() -%}
|
||||
# Copy locally-built Debian package dependencies
|
||||
|
@ -12,14 +12,7 @@ RUN apt-get update && \
|
||||
libdbus-1-3 \
|
||||
libdaemon0 \
|
||||
libjansson4 \
|
||||
libpython2.7 \
|
||||
# Install redis-tools dependencies
|
||||
# TODO: implicitly install dependencies
|
||||
libatomic1 \
|
||||
libjemalloc1 \
|
||||
liblua5.1-0 \
|
||||
lua-bitop \
|
||||
lua-cjson
|
||||
libpython2.7
|
||||
|
||||
{% if docker_teamd_debs.strip() -%}
|
||||
# Copy locally-built Debian package dependencies
|
||||
|
@ -149,6 +149,11 @@ function postStartAction()
|
||||
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
|
||||
fi
|
||||
|
||||
if [[ "$BOOT_TYPE" == "fast" ]]; then
|
||||
# set the key to expire in 3 minutes
|
||||
redis-cli -n 6 SET "FAST_REBOOT|system" "1" "EX" "180"
|
||||
fi
|
||||
|
||||
redis-cli -n 4 SET "CONFIG_DB_INITIALIZED" "1"
|
||||
fi
|
||||
|
||||
|
@ -64,7 +64,12 @@ function getBootType()
|
||||
TYPE='fastfast'
|
||||
;;
|
||||
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
|
||||
TYPE=$(awk '{ if ($1 <= 180) print "fast"; else print "cold" }' /proc/uptime)
|
||||
# check that the key exists
|
||||
if [[ $(redis-cli -n 6 GET "FAST_REBOOT|system") == "1" ]]; then
|
||||
TYPE='fast'
|
||||
else
|
||||
TYPE='cold'
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
TYPE='cold'
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
DOCKER_BASE_STRETCH = docker-base-stretch.gz
|
||||
$(DOCKER_BASE_STRETCH)_PATH = $(DOCKERS_PATH)/docker-base-stretch
|
||||
$(DOCKER_BASE_STRETCH)_DEPENDS += $(SUPERVISOR)
|
||||
$(DOCKER_BASE_STRETCH)_DEPENDS += $(SUPERVISOR) $(REDIS_TOOLS)
|
||||
$(DOCKER_BASE_STRETCH)_DEPENDS += $(SOCAT)
|
||||
|
||||
GDB = gdb
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 904a350107793d44be7167500fcec9087ca3243b
|
||||
Subproject commit 7101eeda1a1ccef2e951e4bea5a2f15d9a43e3b5
|
Loading…
Reference in New Issue
Block a user