Skip to content

Commit e694db2

Browse files
authored
Fix loganalyzer failures on non-smartswitch platforms triggered by #255 (#333)
Why I did it The gNOI shutdown daemon service was causing loganalyzer test failures on non-SmartSwitch platforms (e.g., vlab-01). The service attempted to start via ExecStartPre=/usr/local/bin/check_platform.py, which exited with code 1 on incompatible platforms. This caused systemd to log ERROR messages like: ERR systemd[1]: Failed to start gnoi-shutdown.service - gNOI based DPU Graceful Shutdown Daemon These errors blocked CI/CD submodule updates due to loganalyzer failures. How I did it Changed the service file to use ExecCondition= instead of ExecStartPre= for platform checking: ExecCondition=/usr/bin/python3 /usr/local/bin/check_platform.py runs before service start When check_platform.py returns exit code 1 on non-SmartSwitch platforms, systemd treats this as a condition not met rather than a failure Service is gracefully skipped without error logs on incompatible platforms Changed Restart=always to Restart=on-failure to avoid unnecessary restart attempts when conditions aren't met How to verify it On SmartSwitch NPU platform: Service starts normally and handles DPU graceful shutdown sonic-net/sonic-buildimage#24609 is run with this change Which release branch to backport [x]202511
1 parent 622a444 commit e694db2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

data/debian/sonic-host-services-data.gnoi-shutdown.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ After=network-online.target database.service
66

77
[Service]
88
Type=simple
9-
ExecStartPre=/usr/bin/python3 /usr/local/bin/check_platform.py
9+
ExecCondition=/usr/bin/python3 /usr/local/bin/check_platform.py
1010
ExecStartPre=/bin/bash /usr/local/bin/wait-for-sonic-core.sh
1111
ExecStart=/usr/bin/python3 /usr/local/bin/gnoi_shutdown_daemon.py
12-
Restart=always
12+
Restart=on-failure
1313
RestartSec=5
1414

1515
[Install]

0 commit comments

Comments
 (0)