[launchd-dev] make sure process starts before login window
Quinn
eskimo1 at apple.com
Tue Aug 19 14:49:29 PDT 2008
At 12:02 -0700 19/8/08, Blake Garner wrote:
>I'm looking for suggestions or examples on how to make sure a script
>runs before login window starts. Any ideas on how to make that happen
>within launchd?
It depends on what you mean by "before login window starts". Most
folks who ask this question want to run before the user logs in [1],
either before or after their home directory is mounted, and want to
hold up login while they do their stuff. If that's the case then the
best approach is to use an Authorization Plug-in.
<http://developer.apple.com/documentation/Security/Reference/AuthorizationPluginRef/index.html>
If you'd like to explore this option, drop me a line. I have a draft
technote that I can send your way.
OTOH if you really want to run before loginwindow is /started/ then
things get a /lot/ harder. The problem is that in the launchd world
we boot the system via demand pull. That is, we launch loginwindow
and then, as loginwindow requests services, we start those services.
So the only way to run before loginwindow is to actually patch the
system to not launch loginwindow in the first place. You could do
this by munging <x-man-page://5/ttys> but... yeah, that gets very
ugly very fast. It might be appropriate for a managed site but it's
certainly not something you'd want to do in shrinkwrap software.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
[1] Including automatic logins.
More information about the launchd-dev
mailing list