try an ampersand after the notifydaemon line in your script @bryce.carlson
To me, this sounds like a perfect opportunity to use launchd.
Take a look at http://launchd.info/ and see what you can come up with. You'd want to make a package/dmg that is deployed via policy then is loaded after the policy completes (look at the Files and Processes > Execute Command option in a policy).
Depending on if you want the program and commands to run as the user or as root, you'll want to make it a LaunchAgent or LaunchDaemon. If you want it to run as the currently logged in user, make it a Global LaunchAgent. If you want it run as root make it a Global LaunchDaemon.
I have no experience with this particular app, but you could try adding an ampersand to the end of the notifydaemon line and then exit after, like:
/Library/NSNotifyAgent/daemon/notifydaemon &
exit 0
The ampersands puts the command into the background, so it releases the script to move on, and you can exit. I'm not certain that will work. It kind of depends on how that notifydaemon actually works. If the exit in the script also causes the daemon to exit, then that would be a no-go, but I have a feeling it won't work that way.
Here is a link to a post I made about how I get around forking threads with the JSS (since the jamf binary insists on waiting even with &):
https://jamfnation.jamfsoftware.com/discussion.html?id=14940
It's pretty easy (but non-obvious) to script the creation of a launchdaemon to fork something from a policy without requiring that policy to wait for it to complete. Echo out the launchdaemon to a plist and load it with launchctl. You can even echo out a script for that launchdaemon to run. Putting the files in /tmp makes them go away on reboot.
I am a fan of LaunchDaemons for things like that, @alexjdale and @brandonusher are right on, and you probably need the & as mentioned as well.
@nessts The ampersand did not work. As @alexjdale said JSS still was waiting around for the command to finish up. Even so it was still a good idea. I will keep that in for later so the log in tasks can run at the same time.
@mm2270 Also gave this a try. Same results JSS continued to wait for command:
/Library/NSNotifyAgent/daemon/notifydaemon &
Thanks for the suggestion. I will bake that in later as well.
@alexjdale and @brandonusher I will look at the LaunchDaemons info today and see if I can get that set up and report back. Thanks for the info!
Part of the app/client launches on each boot now (this is with out JSS; want to make sure it runs before I look at packaging it for deployment). After toying with the info on http://launchd.info. The .app file that sits in the menu bar will launch with each startup, but the notifydaemon that listens will not load.
Here is what I have so far:
The /Library/LaunchDaemons/local.start.nsn.plist
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.start.nsn.plist</string>
<key>ProgramArguments</key>
<array>
<string>/Library/uwgb-cit/nsn-start.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
The /Library/uwgb-cit/nsn-start.sh that the LaunchAgent calls
#!/bin/sh
#opens the nsn-message.app
open /Library/NSNotifyAgent/gui/message/message.app
#pause to have the .app open and ready for daemon
sleep 5
#runs the notifydaemon
sudo /Library/NSNotifyAgent/daemon/notifydaemon &
exit 0
Close but no cigar. Any other thoughts? Thanks all for your time!
Edit: I changed to just one LaunchAgent since that only threw the error:
7/9/15 4:09:21.194 PM com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.