Skip to content

Commit eb687ee

Browse files
Fixed systemctl stub for uutils coreutils on Ubuntu 26
The systemctl → echo symlink breaks on Ubuntu 26 because echo is now just an alias into the coreutils multicall binary, which dispatches on argv[0] — invoked as systemctl, it doesn't match, so it fails. Fix: use a no-op stub script that exits 0 instead. Ticket: ENT-14191 Signed-off-by: Ihor Aleksandrychiev <ihor.aleksandrychiev@northern.tech>
1 parent aebeed5 commit eb687ee

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

ci/setup-cfengine-build-host.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ function cleanup() {
2828
set -e
2929
if command -v apt >/dev/null 2>&1; then
3030
# workaround for CFE-4544, remove scriptlets call systemctl even when systemctl is-system-running returns false
31-
rm /bin/systemctl
32-
ln -s /bin/echo /bin/systemctl
31+
# Replace systemctl with a no-op stub that always succeeds. We can't
32+
# symlink to /bin/echo (or /bin/true): on Ubuntu 26 coreutils is the
33+
# single multi-call uutils binary that dispatches on argv[0], so it
34+
# would fail with "coreutils: unknown program 'systemctl'".
35+
rm -f /bin/systemctl
36+
printf '#!/bin/sh\nexit 0\n' > /bin/systemctl
37+
chmod +x /bin/systemctl
3338
apt remove -y cfengine-nova || true
3439
elif command -v yum >/dev/null 2>&1; then
3540
yum erase -y cfengine-nova || true

0 commit comments

Comments
 (0)