Re: How can I "un-sudo" in postflight?
Apple does this a lot:
su $ENV{‘USER’} -c “command and arguments and stuff”
(well, Mavs’s Mail gave that smart quotes. Derp.) On Dec 2, 2013, at 11:40 AM, Mitchell J Laurren-Ring <lists@rynosoft.com> wrote:
I've recently added a launchd plist to my installer and need to load it during postflight (which is running as root). For it to work correctly (as a launch agent), I need to execute launchctl as the current user, not root. I tried using "sudo -u $SUDO_USER" but apparently this ENV variable is set to "launchctl" at postflight time.
How do execute something from postflight as "not root", preferably the installing user?
/Mick _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/installer-dev/bc%40apple.com
This email sent to bc@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Bill Coderre