At 14:21 -0800 22/12/07, Rich Morin wrote:
>Instead, I'd like to know how to set up my Perl script to run as
>early as possible in Leopard, Solaris, etc.
On Mac OS X 10.5 there really isn't a good solution to this. pid 1
is launchd, and launchd starts everything asynchronously (relying on
'demand pull' to sort out the ordering). Thus, there's no easy place
to hook the system so that your script is definitely running before
other specific subsystems ("/etc/rc" is no more).
In terms of supported solutions, the best you can do is create a
launchd daemon and have launchd start it for you. There are a couple
of issues with this:
o What you'll see in the trace will change from boot-to-boot, based
on process scheduling variances. That's less than ideal.
o You probably won't trace anything early because perl requires a lot
of the system to be up and running. For example, it's very likely
that perl calls something like <x-man-page://3/getpwnam>, and will do
a demand pull of DirectoryServices.
In terms of unsupported solutions, you can either go rummaging around
in the kernel or in launchd/launchctl. Check out
system_specific_bootstrap in:
<http://www.opensource.apple.com/darwinsource/10.5/launchd-257/launchd/src/launchctl.c>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
dtrace-discuss mailing list
[email protected]