I'm using a launchd
script found here to automatically re-launch an app if the app crashes:
The app has a menu bar icon. After running that script to trigger re-launching if crashed, I'm noticing a second instance of the menu bar icon appears and annoyingly flashes in the menu bar briefly every 20-30 seconds or so.
It's as if the script actually launches a new instance of the app, which then quickly terminates if an existing instance of the app is already running. When I really just want it to re-launch if closed.
Why is this second application launch occurring?
Are there any launchd
/ launchctl
arguments that will only re-launch the program if it is no longer running?