I have quite a predicament. I have created a binary file /Library/Application Support/XXX/DaemonLauncher. When I try to delete it, I get the following:

$ sudo rm -f /Library/Application\ Support/XXX/DaemonLauncher 
rm: /Library/Application Support/XXX/DaemonLauncher: Permission denied

This seems strange as I am obviously using sudo and root is the owner of the file, which grants all permissions as can be seen:

$ ls -@alO /Library/Application\ Support/XXX/DaemonLauncher
-rwxr-xr-x  1 root  admin  - 1 Oct 23 13:32 /Library/Application Support/XXX/DaemonLauncher

I have noticed other people seem to get permission errors when trying to delete files with sudo if the file is a binary that is currently running, but mine doesn't seem to be:

$ ps aux | grep DaemonLauncher
sschilli          6504   0.0  0.0  4268056    820 s005  S+    1:43PM   0:00.00 grep DaemonLauncher

I can open the file, modify it, and execute it, but am unable to delete it. What could be causing this?

  • @UncleBilly all parent directories have the same permissions: rwxr-xr-x/755 – sschilli Oct 23 '19 at 20:00

Assuming this is a recent version of macOS, you will notice that the root filesystem is mounted read-only, which means that no amount of sudo-ing would make it possible to delete files on it.

I'm not 100% sure how a current macOS system handles its various filesystems, but the root filesystem is mounted read-only while /System/Volumes/Data is overlayed on top of it somehow to provide a layer onto which modifications may be made.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.