Skip to content

Commit 2cea4bc

Browse files
stepanblyschakmssonicbld
authored andcommitted
[config-chassisdb] use cached variables (#17342)
- Why I did it Improve boot performance mostly needed for fast and warmboot - How I did it Use cached variable. - How to verify it Boot the system. Simply do "systemd-analyze blame" and look at service start time. Signed-off-by: Stepan Blyschak <[email protected]>
1 parent bc4bc03 commit 2cea4bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

files/image_config/config-chassisdb/config-chassisdb

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
config_chassis_db() {
2828
startdb_file="/etc/sonic/chassisdb.conf"
2929
[ ! -e $startdb_file ] || rm $startdb_file
30-
platform=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
30+
platform=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
3131
# database-chassis services will start when $chassis_config file exists
3232
chassis_config="/usr/share/sonic/device/$platform/chassisdb.conf"
3333
if [ ! -e $chassis_config ]; then
@@ -54,6 +54,9 @@ config_chassis_db() {
5454
fi
5555
}
5656

57+
# read SONiC immutable variables
58+
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
59+
5760
config_chassis_db
5861

5962
exit 0

0 commit comments

Comments
 (0)