[fast-reboot]: Save fast-reboot state into the db [Nov] (#3892)
- Port changes #3741
This commit is contained in:
parent
68f3b95505
commit
b28dd1db7b
@ -67,6 +67,9 @@ RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return
|
|||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
## Install redis-tools dependencies
|
||||||
|
RUN apt-get -y install libjemalloc1
|
||||||
|
|
||||||
{% if docker_base_dbgs.strip() -%}
|
{% if docker_base_dbgs.strip() -%}
|
||||||
# Install common debug-packages
|
# Install common debug-packages
|
||||||
{%- for dbg_pkg in docker_base_dbgs.split(' ') %}
|
{%- for dbg_pkg in docker_base_dbgs.split(' ') %}
|
||||||
|
@ -11,9 +11,6 @@ RUN apt-get update
|
|||||||
RUN apt-get install -f -y ifupdown arping libdbus-1-3 libdaemon0 libjansson4 libpython2.7
|
RUN apt-get install -f -y ifupdown arping libdbus-1-3 libdaemon0 libjansson4 libpython2.7
|
||||||
|
|
||||||
RUN apt-get install -f -y ndisc6 tcpdump python-scapy
|
RUN apt-get install -f -y ndisc6 tcpdump python-scapy
|
||||||
## Install redis-tools dependencies
|
|
||||||
## TODO: implicitly install dependencies
|
|
||||||
RUN apt-get -y install libjemalloc1
|
|
||||||
|
|
||||||
RUN apt-get install -y libelf1 libmnl0
|
RUN apt-get install -y libelf1 libmnl0
|
||||||
|
|
||||||
|
@ -10,10 +10,6 @@ RUN apt-get update
|
|||||||
|
|
||||||
RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4
|
RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4
|
||||||
|
|
||||||
## Install redis-tools dependencies
|
|
||||||
## TODO: implicitly install dependencies
|
|
||||||
RUN apt-get -y install libjemalloc1
|
|
||||||
|
|
||||||
COPY \
|
COPY \
|
||||||
{% for deb in docker_sonic_telemetry_debs.split(' ') -%}
|
{% for deb in docker_sonic_telemetry_debs.split(' ') -%}
|
||||||
debs/{{ deb }}{{' '}}
|
debs/{{ deb }}{{' '}}
|
||||||
|
@ -10,10 +10,6 @@ RUN apt-get update
|
|||||||
|
|
||||||
RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4 libpython2.7
|
RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4 libpython2.7
|
||||||
|
|
||||||
## Install redis-tools dependencies
|
|
||||||
## TODO: implicitly install dependencies
|
|
||||||
RUN apt-get -y install libjemalloc1
|
|
||||||
|
|
||||||
COPY \
|
COPY \
|
||||||
{% for deb in docker_teamd_debs.split(' ') -%}
|
{% for deb in docker_teamd_debs.split(' ') -%}
|
||||||
debs/{{ deb }}{{' '}}
|
debs/{{ deb }}{{' '}}
|
||||||
|
@ -57,6 +57,11 @@ function postStartAction()
|
|||||||
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
|
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
|
||||||
fi
|
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"
|
redis-cli -n 4 SET "CONFIG_DB_INITIALIZED" "1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -64,7 +64,12 @@ function getBootType()
|
|||||||
TYPE='fastfast'
|
TYPE='fastfast'
|
||||||
;;
|
;;
|
||||||
*SONIC_BOOT_TYPE=fast*|*fast-reboot*)
|
*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'
|
TYPE='cold'
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
DOCKER_BASE = docker-base.gz
|
DOCKER_BASE = docker-base.gz
|
||||||
$(DOCKER_BASE)_PATH = $(DOCKERS_PATH)/docker-base
|
$(DOCKER_BASE)_PATH = $(DOCKERS_PATH)/docker-base
|
||||||
$(DOCKER_BASE)_DEPENDS += $(SUPERVISOR)
|
$(DOCKER_BASE)_DEPENDS += $(SUPERVISOR) $(REDIS_TOOLS)
|
||||||
$(DOCKER_BASE)_DEPENDS += $(BASH)
|
$(DOCKER_BASE)_DEPENDS += $(BASH)
|
||||||
$(DOCKER_BASE)_DEPENDS += $(SOCAT)
|
$(DOCKER_BASE)_DEPENDS += $(SOCAT)
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 904a350107793d44be7167500fcec9087ca3243b
|
Subproject commit 7101eeda1a1ccef2e951e4bea5a2f15d9a43e3b5
|
@ -1 +1 @@
|
|||||||
Subproject commit 4b11836f26d3e5d112a9db07f10fc92912bfdf9b
|
Subproject commit aa092506fb214b7a70d05e19c0389e8d5b163a21
|
Reference in New Issue
Block a user