From d943602d21a09736a6d10d7db4ea3d16f962522d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Garcia?= Date: Wed, 15 Oct 2025 14:33:43 +0000 Subject: [PATCH] TUN-9919: Make RPM postinstall scriplet idempotent * TUN-9919: Make RPM postinstall scriplet idempotent Before this commit the postinstall scriptlet isn't idempotent, meaning the users see this error in their upgrade logs: `ln: failed to create symbolic link '/usr/local/bin/cloudflared': File exists warning: %post(cloudflared-2025.10.0-1.x86_64) scriptlet failed, exit status 1` This doesn't break the upgrade (which is why we haven't touched this in 5 years), but adding the -f (force) flag to the symlink command prevents this issue from happening Closes TUN-9919 --- postinst.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postinst.sh b/postinst.sh index d460ef3e..8531f3c4 100644 --- a/postinst.sh +++ b/postinst.sh @@ -1,5 +1,5 @@ #!/bin/bash set -eu -ln -s /usr/bin/cloudflared /usr/local/bin/cloudflared +ln -sf /usr/bin/cloudflared /usr/local/bin/cloudflared mkdir -p /usr/local/etc/cloudflared/ touch /usr/local/etc/cloudflared/.installedFromPackageManager || true