Posted on 01-29-2020 12:43 PM
Hi.
I am running into an issue that has become more prevalent with our DEPNotify workflow. Our enrollment policy is failing out when the DEPNotify-Starter script tries to open the app. It errors out with LSOpenURLsWithRole() failed for the application /Applications/Utilities/DEPNotify.app/Contents/MacOS/DEPNotify with error -54
. I'm told its a permissions issue but I'm not sure with what. The app is installing to /Applications/Utilities as the script would expect and all the permissions are the same as when this actually worked. I've seen it happen on both Catalina and Mojave clients. The only way I actually get it to work is by manually clicking the DEPNotify app to launch it. Anyone else seen this? Oh I'm using DEPNotify 1.1.5 and DEPNotify-Starter 2.0.1 FYI
Solved! Go to Solution.
Posted on 01-30-2020 07:55 AM
@sgorney This is the relevant code in the DEPNotify-Starter script:
#!/bin/bash
sudo -u "$CURRENT_USER" open -a "$DEP_NOTIFY_APP" --args -path "$DEP_NOTIFY_LOG"
You might try this:
#!/bin/bash
loggedInUID=$(/usr/bin/id -u "$CURRENT_USER")
/bin/launchctl asuser "$loggedInUID" /usr/bin/open -a "$DEP_NOTIFY_APP" --args -path "$DEP_NOTIFY_LOG"
Posted on 01-29-2020 12:46 PM
Are you using a policy to kick off the script or is it copied local and executed with a LaunchAgent or something?
Posted on 01-29-2020 12:48 PM
@tanderson Policy triggered by enrollment complete
Posted on 01-30-2020 07:55 AM
@sgorney This is the relevant code in the DEPNotify-Starter script:
#!/bin/bash
sudo -u "$CURRENT_USER" open -a "$DEP_NOTIFY_APP" --args -path "$DEP_NOTIFY_LOG"
You might try this:
#!/bin/bash
loggedInUID=$(/usr/bin/id -u "$CURRENT_USER")
/bin/launchctl asuser "$loggedInUID" /usr/bin/open -a "$DEP_NOTIFY_APP" --args -path "$DEP_NOTIFY_LOG"
Posted on 02-10-2020 05:08 PM
There are a few areas with the above code. Should we replace all references of it?
Posted on 04-16-2020 07:49 AM
I found three areas and replaced all three. The change worked for me. A million thanks!!!
Posted on 09-16-2020 02:54 PM
Thanks. I assume leave the -jamf at the end of the string?