From e03697bade96eb19faf43e90e2ed8da86e07b4cc Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 15 Oct 2024 21:41:40 +0100 Subject: ci: Fix disabling of the mono-xsp4.service With Ubuntu 24.04 this service is no longer enabled/installed and so this bit would fail. This commit makes it handle both cases (installed/not-installed). Signed-off-by: Andrew Clayton --- .github/workflows/ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f9bc699..a7d0e715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,12 +101,18 @@ jobs: # https://github.com/actions/runner-images/issues/2821 - name: Kill mono process run: | - sudo systemctl stop mono-xsp4.service - sudo systemctl mask mono-xsp4.service - sudo systemctl status mono-xsp4.service || true - PID=$(sudo lsof -t -i :8084) - echo "Killing PID $PID" - sudo kill -9 $PID + set +e + sudo systemctl status mono-xsp4.service + if [ $? -ne 0 ]; then + true + else + sudo systemctl stop mono-xsp4.service + sudo systemctl mask mono-xsp4.service + sudo systemctl status mono-xsp4.service + PID=$(sudo lsof -t -i :8084) + echo "Killing PID $PID" + sudo kill -9 $PID + fi ## ## njs -- cgit