This is one of the examples that I meant - they work but they change the default ownership on the /private/tmp system folder. After this command, it is owned by your user account (because the variable $(whoami) resolves to the name of your user account), not root. Showing this in the Terminal:
List the ownership and permissions of /tmp:
mario@chronic / % ls -ld /tmp
lrwxr-xr-x@ 1 root wheel 11 Dec 15 15:43 /tmp → private/tmp
(owned by user root and group wheel. Only root can write. /tmp is a link to /private/tmp)
List the ownership and permissions of /private/tmp:
mario@chronic / % ls -ld /private/tmp
drwxrwxrwt 7 root wheel 224 Mar 6 16:08 /private/tmp
(owned by user root and group wheel. Everyone can read and write)
Change the owner with the found command:
mario@chronic / % sudo chown $(whoami) /tmp
List again:
mario@chronic / % ls -ld /tmp
lrwxr-xr-x@ 1 root wheel 11 Dec 15 15:43 /tmp → private/tmp
mario@chronic / % ls -ld /private/tmp
drwxrwxrwt 7 mario wheel 224 Mar 6 16:08 /private/tmp
The owner is now mario (my user account) and not root. It is not a security disaster because everyone on the machine can read and write into /tmp/private anyway, based on the original directory permissions, but it is not pretty and who knows which software stumbles over it in the future.
To reset this:
mario@chronic / % sudo chown root /tmp
(this sets the owner back to root in the same way as previously it set it to mario)
List again to verify:
mario@chronic / % ls -ld /private/tmp
drwxrwxrwt 7 root wheel 224 Mar 6 16:08 /private/tmp
mario@chronic / % ls -ld /tmp
lrwxr-xr-x@ 1 root wheel 11 Dec 15 15:43 /tmp → private/tmp
mario@chronic / %
Instead of the sudo chown $(whoami) /tmp you should be able to delete any possibly existing lock file by navigating to /tmp in the Apple Finder or Terminal and deleting any file ending in “.lck” and in some way having Roon in its name.
Do this ONLY after completely shutting down Roon and RoonServer. Otherwise it may lead to corruption as two Roon instances might possibly get started at the same time (and who knows what this does to the database)