c9483796dc
- move single instance services into their own folder - generate Systemd templates for any multi-instance service files in slave.mk - detect single or multi-instance platform in systemd-sonic-generator based on asic.conf platform specific file. - update container hostname after creation instead of during creation (docker_image_ctl) - run Docker containers in a network namespace if specified - add a service to create a simulated multi-ASIC topology on the virtual switch platform Signed-off-by: Lawrence Lee <t-lale@microsoft.com> Signed-off-by: Suvarna Meenakshi <Suvarna.Meenaksh@microsoft.com>
31 lines
1.0 KiB
Bash
Executable File
31 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# This script is invoked by topology.service only
|
|
# for multi-asic virtual platform. For multi-asic platform
|
|
# multiple Database instances are present
|
|
# and HWKSU information is retrieved from first database instance.
|
|
#
|
|
|
|
start() {
|
|
DB_FIRST_INSTANCE="/var/run/redis0/redis.sock"
|
|
TOPOLOGY_SCRIPT="topology.sh"
|
|
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform -s $DB_FIRST_INSTANCE`
|
|
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]' -s $DB_FIRST_INSTANCE`
|
|
/usr/share/sonic/device/$PLATFORM/$HWSKU/$TOPOLOGY_SCRIPT start
|
|
}
|
|
stop() {
|
|
DB_FIRST_INSTANCE="/var/run/redis0/redis.sock"
|
|
TOPOLOGY_SCRIPT="topology.sh"
|
|
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform -s $DB_FIRST_INSTANCE`
|
|
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]' -s $DB_FIRST_INSTANCE`
|
|
/usr/share/sonic/device/$PLATFORM/$HWSKU/$TOPOLOGY_SCRIPT stop
|
|
}
|
|
|
|
case "$1" in
|
|
start|stop)
|
|
$1
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop}"
|
|
;;
|
|
esac
|