Re: Option to execute a command?
Re: Option to execute a command?
- Subject: Re: Option to execute a command?
- From: Per Olofsson <email@hidden>
- Date: Thu, 31 Mar 2011 07:07:31 +0000
- 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-for-all-users-with-gui-sessions
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden