I'm trying to run a script whenever a user logs in via ldap that sets up the home directory, by mounting some folders. The problem is I want to hang the login process until this has been done, because everything needs to be set up before the desktop appears. I tried using LoginHook but it seems like that feature is gone for good in Ventura. I also tried using outset as a replacement but its scripts run very late, well after the login process has been successful.
An idea I had was creating a LaunchDeamon that watches the User directory for file access, would such an approach be feasable? It has to be blocking further access to the user directory until the script is done, I don't know if this can be done. Maybe there are better ways I haven't considered yet.