Re: How to execute script as root, and then an another script on behalf of an ordinary user
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=KhqOLMqqtZHe6ZT9uiVz+qwVlt+aGN2zaE6u+pO3Bv8=; b=fA1iHrDJri1AMigUksbSXall62uS64qGwwVjnlp/Zdt0qh2DQt2gML2KuFQ9TIYeca NoXf+fb16Aap4JiFxOoJPwYkccIlzBYihz5hQNmGrKHBd37Ali2HFiGrHl19cw5XA4MX tLUrUSXJKshuZGORwKd82Sf/4/URTiRG+0hok= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RcMY4Pjh0FR4SP0h5otnZg8JqKAsS2MvUA0IRTrt0g3a1/UztuwyP/n9PfmdUPH7t1 c20QvcbnlFm/GXKOFyIkXlGerz0kiGCGypxidBRmjt0SopyqVEVQYkYRbU+tB4l9t5e9 TCguImKVj34golHHUtTol8O6rFcAqIbVH2Ycc=
Why aren't these simply part of the package payload?
There are a lot of different places where i need to install files. it is /Library/LaunchAgents, /Library/LaunchDaemons, /Library/Application Support, /Library/PreferencePanes. It would require as many "PackageMaker targets" as locations. I don't know why but on my system it compiles too much time (with every new location), for strange reasons creates packages more than 400 Mb in size from time to time and the installing time is unacceptable. Maybe i don't know something (albeit i was following Apple's Application distribution guidelines), so i decided to have one target - in /tmp, and run a big postinstall script which does all the movements to the right directories, chmod's and chown's all the files, starts daemons/kexts and deletes that /tmp/TempDir file. Maybe i should have looked at console version of packagemaker?
This is difficult to do correctly in all instances. See http://stackoverflow.com/questions/1106638/starting-stopping-a-launchd-agent...
Thanks a lot for the link! What do you mean by "all instances"? As far as i understand, i need to find a pid of some process that was launched by the current logged in user. Finder, for example. And then execute launchctl bsexec [finderPID] "/tmp/myloadscript". Or i am wrong? Are there any additional pitfalls?
It may be easier to simply require a logout (or a reboot) after install; when the user logs back in the LaunchDaemon will be loaded.
Yes, i was thinking about, but users don't like to reboot the system, at least me, i consider that as old past times. Of course if i am unable to do this without rebooting, i'd use your advice. Thank you again _______________________________________________ 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)
-
eveningnick eveningnick