sonic-buildimage/platform/mellanox/nv-syncd-shared/nv-syncd-shared.service
mssonicbld 33a10b479a
[nvidia] make sure shared storage with syncd is cleared on restarts (#14547) (#16046)
Why I did it
Sharing the storage of syncd with other proprietary application extensions allows them to communicate with syncd in differnt ways.
If one container wants to pass some information to syncd then shared storage can be used. However, today the shared storage isn't cleaned on restarts making it possible for syncd to read out-of-date information generated in the past.

NOTE: No plans to use it for standard SONIC dockers and we are working on removing the SDK dependency from PMON docker

How I did it
Implemented new service to clean the shared storage.

How to verify it
Do reboot/fast-reboot/warm-reboot/config-reload/systemctl restart swss and verify /tmp/ is cleaned after each restart in syncd container.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Co-authored-by: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com>
2023-08-07 09:27:43 +08:00

18 lines
326 B
Desktop File

[Unit]
Description=Manage Nvidia specific syncd shared volume
Requires=docker.service
After=docker.service
BindsTo=sonic.target
After=sonic.target
PartOf=syncd.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=rm -rf /tmp/nv-syncd-shared/
ExecStart=mkdir -p /tmp/nv-syncd-shared/
[Install]
WantedBy=sonic.target