I have the following situation with my macOS 10.14.6:
- A while ago I started experiencing my MacBook Pro hanged just after the login screen with user/password. Only the desktop and its icons show, the spinning wheel shows forever, I cannot do anything (no Cmd+Option+Esc, no way to go back to the login screen and switch user) and the only way to (gently) unlock it is to ssh to the machine from my smartphone and issue
kill -9 -1(ie, kill all the processes belonging to the user I'm trying to log in.
- This happens only upon the first login after shutdown or reboot. Once I've unlocked the user with the killing, subsequent logins go well until the next reboot.
- This happens only if, after reboot, I do the first login with a given account (the one I usually work with and which has many customisations), it doesn't happen if I first login with another (cleaner) account and then I login with the troubled one.
- I've already tried the most trivial things: remove login items, stop a few launchd services, SMC reset, check the logs, use the ssh session and top to keep an eye on started processes. But no luck, I can't find what it is.
- Somewhere I was suggested to login by clicking on the right arrow next to the password field and keeping the Option key pressed. Magically, this worked, but I suppose that key combination is to disable startup things I might need later.
- Restarting in recovery mode doesn't make sense here: very likely it would work, but I wouldn't gain any particular info on the guilty process and it will keep hanging until I discover it.
So, my question is: as an advanced user how could I troubleshoot all the things that happen after login? Quite clearly, the graphical interface is waiting for some other program to finish (or some other signal), but how is it possible to know? Is there some tool (in addition to inspecting the logs, using
pstree)? Is there some technical documentation on how the whole thing works?
EDIT: since I'm receiving comments like "try this and that", note that I'm asking the highlighted question, not one of the many things I could try, many of which can already be found with Google, I already know (and tried) a number of them.