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
This commit is contained in:
Gonçalo Garcia 2025-10-15 14:33:43 +00:00
parent e10e072599
commit d943602d21
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
set -eu 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/ mkdir -p /usr/local/etc/cloudflared/
touch /usr/local/etc/cloudflared/.installedFromPackageManager || true touch /usr/local/etc/cloudflared/.installedFromPackageManager || true