Re: Option to execute a command?
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Thread-index: AQHL7kJU1BT4POw5L0OnxLhGDUmecpRFVkuAgACuEoCAAAIlgIAAC5aAgAACpgCAAAnaAIAAD+sAgAC4C4A= Thread-topic: Option to execute a command? 30 mar 2011 kl. 22:08 skrev Nathan Sims:
Thanks Karl, Greg, and Per. I am much farther along now.
When I run my build package, the installation fails due to not being able to run the pre and post scripts:
installd[2326]: PackageKit: Executing script "./preinstall" in /private/tmp/PKInstallSandbox.d9BoJ7/Scripts installd[2326]: ./preinstall: launchctl: Error unloading: edu.caltech.autonomy.foo . . . installd[2326]: PackageKit: Executing script "./postinstall" in /private/tmp/PKInstallSandbox.d9BoJ7/Scripts/ installd[2326]: ./postinstall: launchctl: Dubious ownership on file (skipping): /Library/LaunchAgents/edu.caltech.autonomy.foo.plist installd[2326]: ./postinstall: nothing found to load
What ownership is the plist file supposed to have?
root:wheel chmodded 0644. Binaries that are executed should also be owned by root, and sit in a root owned directory, otherwise you'll have an easy way to privilege escalation.
All the files have been moved into the correct places on disk by the installer, and the scripts are all +x. If I manually do a 'launchctl load /Library/LaunchAgents/edu.caltech.autonomy.foo.plist' it works, but the installer doesn't seem to like it.
Ah, I assumed that you need to load a LaunchDaemon, which executes in the system's context, but you're loading a LaunchAgent, which executes in the user's session. Loading and unloading LaunchAgents for users is notoriously difficult, see: http://stackoverflow.com/questions/1106638/starting-stopping-a-launchd-agent... http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSy... The easiest way to fix it is to set the Restart Action to Require Logout. -- Per Olofsson System Administrator, ITS, University of Gothenburg _______________________________________________ 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: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Per Olofsson