Encountering an error when restarting Roon from the command line on a Mac

I would like to restart Roon on my Mac daily, and have written a simple script to do so:

#!/bin/zsh
killall RoonServer
open -a /Applications/Roon.app/Contents/RoonServer.app

This works well for terminating Roon, and the “open” command works well by itself, but when I execute the above script, I get:

_LSOpenURLsWithCompletionHandler() failed for the application /Applications/Roon.app/Contents/RoonServer.app with error -600.

I granted Roon full disk access in hope that that would help, but it didn’t.

Any ideas?

Did you try adding a few seconds of sleep between killing and reopening? The killall default is to perform a clean shutdown of the process, so maybe it takes a bit for the server process and all its handles to disappear, as it has to write database state to disk?

2 Likes

I added a “sleep 5” between the two commands, and sure enough, that weird “_LSOpenURLs…” error is gone. Thanks for the suggestion!

3 Likes