DEPNotify GUI not starting

sgorney
New Contributor III

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

1 ACCEPTED SOLUTION

ryan_ball
Valued Contributor

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

View solution in original post

6 REPLIES 6

tanderson
Contributor

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

sgorney
New Contributor III

@tanderson Policy triggered by enrollment complete

ryan_ball
Valued Contributor

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

seanism
New Contributor III

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

jp2019
New Contributor III

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

seanism
New Contributor III

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