Re: How to execute script as root, and then an another script on behalf of an ordinary user
Re: How to execute script as root, and then an another script on behalf of an ordinary user
- Subject: Re: How to execute script as root, and then an another script on behalf of an ordinary user
- From: eveningnick eveningnick <email@hidden>
- Date: Wed, 5 Jan 2011 17:46:50 +0200
> 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-for-all-users-with-gui-sessions
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden