• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can I "un-sudo" in postflight?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I "un-sudo" in postflight?


  • Subject: How can I "un-sudo" in postflight?
  • From: Mitchell J Laurren-Ring <email@hidden>
  • Date: Mon, 02 Dec 2013 11:40:29 -0800

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How can I "un-sudo" in postflight?
      • From: Stephane Sudre <email@hidden>
    • Re: How can I "un-sudo" in postflight?
      • From: Per Olofsson <email@hidden>
    • Re: How can I "un-sudo" in postflight?
      • From: Bill Coderre <email@hidden>
    • Re: How can I "un-sudo" in postflight?
      • From: Conor Schutzman <email@hidden>
    • Re: How can I "un-sudo" in postflight?
      • From: Rustam Muginov <email@hidden>
  • Prev by Date: Re: place a LaunchAgent on the filesystem, but prevent it from loading unless a boolean key is True
  • Next by Date: Re: How can I "un-sudo" in postflight?
  • Previous by thread: Re: place a LaunchAgent on the filesystem, but prevent it from loading unless a boolean key is True
  • Next by thread: Re: How can I "un-sudo" in postflight?
  • Index(es):
    • Date
    • Thread