MSL Wiki
MSL on GitHub

MSL's observer

The separate program that watches MSL, what it records, and when it interrupts you.

Chapter 17 of 202 min read
On this page 4 sections

mslod is a small program that watches MSL from outside and does nothing else. It is installed beside MSL's other programs and runs as its own login job - never inside MSL's background service, because a watchdog that lives in the thing it watches is missing at the only moment it matters.

Nothing in MSL depends on it. If it is not running, MSL works exactly the same; you simply get no report when something goes badly wrong. msl doctor says whether it is running.

What it watches#

From outside, every few seconds, using nothing but the process table and MSL's own control socket:

  • the background service starting, stopping and being replaced, by process id;
  • whether it answers, not merely whether it can be connected to - a socket accepts connections on the kernel's behalf, so connecting proves nothing;
  • every Linux application host starting and ending, and which instance each belongs to;
  • your instances appearing, running and stopping;
  • crash reports macOS writes for any part of MSL, and the exception type inside them;
  • whether MSL's own folder can be written and its list of instances read.

It also quotes MSL's own log lines into its record, so one file holds both what MSL said about itself and what was seen from outside. Guest kernel output is left out - that is Linux talking, not MSL.

When it interrupts you#

Almost never, by design. A crash screen for a healthy MSL is worse than no observer at all, so every threshold is minutes rather than seconds, and all of the following are recorded and not shown:

  • one crash that the service came back from - that is the system working;
  • the service being replaced during an update, or booted out by the installer;
  • launchctl kickstart;
  • a slow reply while MSL freezes and saves a guest's memory, however long that takes - a service still writing its own log is busy, not wedged;
  • the Mac waking from sleep;
  • the service being off because you turned it off;
  • MSL having already put up its own crash screen, which says more than the observer can.

What it does show is a state MSL has been in for minutes and cannot get out of: the service in a restart loop, a service that has stopped replying, a missing installation, or a folder MSL cannot use. Each is one of the stop codes, and each is shown once per session.

Its record#

~/Library/Logs/MSL/observer.log, and it belongs to this time you turned the Mac on. The next boot deletes it and starts again, so there is nothing to clear out and nothing that grows forever. Restarting the observer, or MSL, does not clear it - only booting does.

That is deliberately short-lived, so an incident keeps its own copy. When the observer raises a stop code it writes observer-incident.txt into ~/Library/Application Support/MSL with the code, what it measured, and the tail of what it saw beforehand. Copy report on the crash screen includes all of it. That file survives the log, and is removed once the screen has shown it.

Turning it off#

It follows Start MSL's background service in Settings. Turning that off removes the observer's job along with the service's; turning it back on reinstates both.