Skip to main content

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

Are you using a policy to kick off the script or is it copied local and executed with a LaunchAgent or something?


@tanderson Policy triggered by enrollment complete


@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"

There are a few areas with the above code. Should we replace all references of it?


I found three areas and replaced all three. The change worked for me. A million thanks!!!


Thanks. I assume leave the -jamf at the end of the string?