I'm working on a silent deployment of an agent that needs to install to and run as a service in the user context. Running the .pkg installer as the user via a bash script produces an error from the installer process when recurring checkin is used as the trigger:
PackageKit: XPC error in __43-[_PKInstallClientConnection blockingProxy]_block_invoke (Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.installd.user was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.installd.user was invalidated.})
The installation, however, works if run via "sudo jamf policy" in terminal as well as through Self Service.
Workarounds such as using a custom plist that at load calls script that runs the installation as well as copying files down via dmg and using a sudo -u $user launchtl load command via bash script do work - but only for users with administrative privileges. As it stands, I haven't found a way to successfully install and start the service for a standard user silently.
Wondering if anyone has ever had a need to do something similar with regard to installing something in the user profile that also needs to load a plist in the user context as well (an agent that just runs all the time as the user, not in the system/root context). That or if anyone has any suggestions of other wacky things to try in order to get a workaround going. Any recommendations would be helpful. I've also been primarily a windows admin/syseng historically, so please excuse my OS X/bash/etc. ignorance if/when it is displayed.
