Posted on 11-18-2021 01:44 PM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.cloudflare.warp.lc</string>
<key>Program</key>
<string>/Applications/Cloudflare WARP.app/Contents/MacOS/Cloudflare WARP</string>
</dict>
</plist>
Posted on 11-18-2021 09:25 PM
Hmm. I wonder. You might try adding a LimitLoadToSessionType key to the launchd.
<key>LimitLoadToSessionType</key>
<string>Aqua</string>
If I'm not mistaken, that should tell the LaunchDaemon to only run when someone is logged in, that way it won't try to open the application during the restart process, but only once login has occurred.
This is just a guess. I haven't actually seen an instance of a LaunchDaemon causing an app to open twice like that myself. Hopefully adding that key to your launchd will address it.
Posted on 11-19-2021 03:19 AM
@mm2270 thanks so much for jumping in and offering help.
So I made the change you recommended and sadly no dice. Two instances of the app are opened on reboot. Of course the fix would be to have the app not open on boot and have the launchd manage it, but once the app is managed via preferences in Jamf, we cannot disable it from starting automatically. A failure of the vendor.
I had hoped launchd had a way to see an instance was already open and not open another.
11-23-2021 07:09 AM - edited 11-23-2021 07:13 AM
#!/bin/sh
# find running instances of Cloudflare using grep
ps ax | grep -v grep | grep "/Applications/Cloudflare WARP.app"
# if grep finds no matches it will return an error code (> 0)
if [ $? -gt 0 ]; then
"/Applications/Cloudflare WARP.app/Contents/MacOS/Cloudflare WARP"
fi