Skip to content

/usr/local/sbin Is a Symlink: The "Duplicate" Script That Was One File

On merged-usr Fedora (seen on Fedora 44), /usr/local/sbin is a symlink to bin:

$ ls -ld /usr/local/sbin
lrwxrwxrwx. 1 root root 3 May 18 04:30 /usr/local/sbin -> bin

So a script visible at both /usr/local/bin/foo.sh and /usr/local/sbin/foo.sh — identical size, identical mtime — is one file seen through two paths, not a stale duplicate from an old hand-deploy.

How this bites

An Ansible role installed a notifier to /usr/local/sbin/, and a cleanup task then removed the "stray duplicate" at /usr/local/bin/ — deleting the file the role had just installed. The systemd timer failed 203/EXEC every minute until redeploy. The sequence looks completely reasonable in review; the directory listing even supports the duplicate theory unless you check the directory itself.

The checks

Before deduplicating anything across bin/sbin (or any suspiciously identical pair):

ls -ld /usr/local/sbin /usr/local/bin      # is one a symlink?
stat -c '%i' path1 path2                    # same inode = same file

And never encode a removal for the other path of a merged pair into configuration management — the "cleanup" re-deletes your deployment on every run.