Skip to content

Commit 821c43c

Browse files
authored
[Mellanox][Smartswitch]Changes for mounting dbus socket (#20816)
Why I did it This PR is a temporary change, once the rshim interface will be replaced this PR will not be required anymore To mount the dbus socket in pmon container as systemctl command has to be executed to start/stop service from PMON container during admin state/ reboot command execution dockers/docker-platform-monitor/Dockerfile.j2 - Addition of dbus package for mellanox specific platform in order to use dbus-send command files/build_templates/docker_image_ctl.j2 - Mount socket, since we need to use the systemctl command to start/stop service from pmon container How I did it How to verify it dbus-send commands in Pmon container can be performed in order to start / stop the [email protected] which is relevant for starting or stopping the rshim service
1 parent 39e2131 commit 821c43c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

dockers/docker-platform-monitor/Dockerfile.j2

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ RUN apt-get update && \
2929
nvme-cli \
3030
ethtool \
3131
xxd
32+
{% if sonic_asic_platform == 'mellanox' %}
33+
RUN apt-get install -y dbus
34+
{% endif %}
3235

3336
# smartmontools version should match the installed smartmontools in sonic_debian_extension build template
3437
RUN apt-get install -y -t bookworm-backports \

files/build_templates/docker_image_ctl.j2

+8
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,13 @@ start() {
621621

622622
{%- if sonic_asic_platform == "mellanox" %}
623623
# TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version
624+
{%- if docker_container_name == "pmon" %}
625+
if [[ $NUM_DPU -gt 0 ]]; then
626+
SMARTSWITCH_MNT= " -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket"
627+
else
628+
SMARTSWITCH_MNT= ""
629+
fi
630+
{%- endif %}
624631
{%- endif %}
625632
docker create {{docker_image_run_opt}} \
626633
{%- if docker_container_name != "dhcp_server" %}
@@ -648,6 +655,7 @@ start() {
648655
-v /var/run/hw-management:/var/run/hw-management:rw \
649656
-v mlnx_sdk_socket:/var/run/sx_sdk \
650657
-v /tmp/nv-syncd-shared/:/tmp \
658+
$SMARTSWITCH_MNT \
651659
-v /dev/shm:/dev/shm:rw \
652660
-e SX_API_SOCKET_FILE=/var/run/sx_sdk/sx_api.sock \
653661
-v /dev/shm:/dev/shm:rw \

0 commit comments

Comments
 (0)