Skip to main content
Solved

DEPNotify GUI not starting

  • January 29, 2020
  • 6 replies
  • 48 views

Forum|alt.badge.img+5

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

Best answer by ryan_ball

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

6 replies

Forum|alt.badge.img+8
  • Contributor
  • January 29, 2020

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


Forum|alt.badge.img+5
  • Author
  • Contributor
  • January 29, 2020

@tanderson Policy triggered by enrollment complete


Forum|alt.badge.img+19
  • Contributor
  • Answer
  • January 30, 2020

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

Forum|alt.badge.img+4
  • New Contributor
  • February 11, 2020

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


Forum|alt.badge.img+4
  • Contributor
  • April 16, 2020

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


Forum|alt.badge.img+4
  • New Contributor
  • September 16, 2020

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