2020-03-31 12:06:19 -05:00
|
|
|
[Unit]
|
|
|
|
Description=LLDP container
|
|
|
|
Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
|
|
|
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
|
|
|
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
|
|
|
|
After=syncd{% if multi_instance == 'true' %}@%i{% endif %}.service
|
|
|
|
Requires=updategraph.service
|
|
|
|
After=updategraph.service
|
2021-02-25 06:26:24 -06:00
|
|
|
BindsTo=sonic.target
|
|
|
|
After=sonic.target
|
|
|
|
BindsTo=sonic.target
|
|
|
|
After=sonic.target
|
2020-03-31 12:06:19 -05:00
|
|
|
Before=ntp-config.service
|
|
|
|
StartLimitIntervalSec=1200
|
|
|
|
StartLimitBurst=3
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
User={{ sonicadmin_user }}
|
[systemd] ASIC status based service bringup on VOQ chassis (#7477)
Changes to allow starting per asic services like swss and syncd only if the platform vendor codedetects the asic is detected and notified. The systemd services ordering we want is database->database@->pmon->swss@->syncd@->teamd@->lldp@
There is also a requirement that management, telemetry, snmp dockers can start even if all asic services are not up.
Why I did it
For VOQ chassis, the fabric cards will have 1-N asics. Also, there could be multiple removable fabric cards. On the supervisor, swss and syncd containers need to be started only if the fabric-card is in Online state and respective asics are detected by the kernel. Using systemd, the dependent services can be in inactive state.
How I did it
Introduce a mechanism where all ASIC dependent service wait on its state to be published via PMON to REDIS. Once the subscription is received, the service proceeds to create respective dockers.
For fixed platforms, systemd is unchanged i.e. the service bring up and docker creation happens in the start()/ExecStartPre routine of the .sh scripts.
For VOQ chassis platform on supervisor, the service bringup skips docker creation in the start() routine, but does it in the wait()/ExecStart routine of the .sh scrips.
Management dockers are decoupled from ASIC docker creation.
2021-07-28 01:02:49 -05:00
|
|
|
ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start{% if multi_instance == 'true' %} %i{% endif %}
|
|
|
|
ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'true' %} %i{% endif %}
|
|
|
|
ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %}
|
2020-03-31 12:06:19 -05:00
|
|
|
RestartSec=30
|
|
|
|
|
|
|
|
[Install]
|
2021-02-25 06:26:24 -06:00
|
|
|
WantedBy=sonic.target
|