From 51136c6fb0792504bbe517d0911b5434d477e500 Mon Sep 17 00:00:00 2001 From: Daniel Hast Date: Wed, 11 Feb 2026 08:18:50 -0500 Subject: [PATCH] fix: use ConditionPathExists for update service checks The ConditionFileIsExecutable check doesn't seem to be working properly for some users, and ConditionPathExists should definitely work. Also use `/bin/sh` instead of `/usr/bin/bash` in these services for portability. --- usr/lib/systemd/system/brew-update.service | 5 +++-- usr/lib/systemd/system/brew-upgrade.service | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/usr/lib/systemd/system/brew-update.service b/usr/lib/systemd/system/brew-update.service index 4198ec3..33b77f3 100644 --- a/usr/lib/systemd/system/brew-update.service +++ b/usr/lib/systemd/system/brew-update.service @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: Copyright 2025 Universal Blue # SPDX-FileCopyrightText: Copyright 2025 The BlueBuild Authors +# SPDX-FileCopyrightText: Copyright 2026 Daniel Hast # # SPDX-License-Identifier: Apache-2.0 @@ -7,7 +8,7 @@ Description=Auto-update Brew binary After=local-fs.target After=network-online.target -ConditionFileIsExecutable=/home/linuxbrew/.linuxbrew/bin/brew +ConditionPathExists=/home/linuxbrew/.linuxbrew/bin/brew [Service] User=1000 @@ -15,4 +16,4 @@ Type=oneshot Environment=HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar Environment=HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew Environment=HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew -ExecStart=/usr/bin/bash -c "/home/linuxbrew/.linuxbrew/bin/brew update" +ExecStart=/bin/sh -c "/home/linuxbrew/.linuxbrew/bin/brew update" diff --git a/usr/lib/systemd/system/brew-upgrade.service b/usr/lib/systemd/system/brew-upgrade.service index f65a0d8..47d6bbe 100644 --- a/usr/lib/systemd/system/brew-upgrade.service +++ b/usr/lib/systemd/system/brew-upgrade.service @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: Copyright 2025 Universal Blue # SPDX-FileCopyrightText: Copyright 2025 The BlueBuild Authors +# SPDX-FileCopyrightText: Copyright 2026 Daniel Hast # # SPDX-License-Identifier: Apache-2.0 @@ -7,7 +8,7 @@ Description=Auto-upgrade Brew packages After=local-fs.target After=network-online.target -ConditionFileIsExecutable=/home/linuxbrew/.linuxbrew/bin/brew +ConditionPathExists=/home/linuxbrew/.linuxbrew/bin/brew [Service] User=1000 @@ -15,9 +16,9 @@ Type=oneshot Environment=HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar Environment=HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew Environment=HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew -ExecStart=/usr/bin/bash -c "/home/linuxbrew/.linuxbrew/bin/brew upgrade" -ExecStartPost=-/usr/bin/bash -c "/home/linuxbrew/.linuxbrew/bin/brew unlink systemd" -ExecStartPost=-/usr/bin/bash -c "/home/linuxbrew/.linuxbrew/bin/brew unlink dbus" -ExecStartPost=-/usr/bin/bash -c "/home/linuxbrew/.linuxbrew/bin/brew unlink gsettings" -ExecStartPost=-/usr/bin/bash -c "/home/linuxbrew/.linuxbrew/bin/brew unlink bash" -ExecStartPost=-/usr/bin/bash -c "/home/linuxbrew/.linuxbrew/bin/brew unlink rpm" +ExecStart=/bin/sh -c "/home/linuxbrew/.linuxbrew/bin/brew upgrade" +ExecStartPost=-/bin/sh -c "/home/linuxbrew/.linuxbrew/bin/brew unlink systemd" +ExecStartPost=-/bin/sh -c "/home/linuxbrew/.linuxbrew/bin/brew unlink dbus" +ExecStartPost=-/bin/sh -c "/home/linuxbrew/.linuxbrew/bin/brew unlink gsettings" +ExecStartPost=-/bin/sh -c "/home/linuxbrew/.linuxbrew/bin/brew unlink bash" +ExecStartPost=-/bin/sh -c "/home/linuxbrew/.linuxbrew/bin/brew unlink rpm"