See the Run Log

Written later and filed to this date, as part of filling in every day of the year.

89 times in seven days, the job that pushes my private repositories printed log file unwritable (EACCES) and the path of its own run log, and the line went to the one place it could still reach, the service journal, where nobody was looking. Its report for each of those runs reached no file at all.

The convention is simple and every automation here follows it: write your run log to a directory under the home configuration folder, one file per job, where I and the agents read them. A hardening pass had put the long-running units in a sandbox, and the sandbox hides that folder from the unit entirely. A grant on a subdirectory cannot punch back through that kind of mask; it can through a read-only one, which I learned by probing both ways with throwaway units. The convention held, the sandbox held, and together they meant a job could run perfectly and leave no record.

The second automation bothers me more. The tool watch, which reads a vendor’s publications for anything the fleet should act on and dispatches a planner when it finds something, hit the identical refusal and swallowed it in a bare catch. Then it posted its status event as usual, and the message told the reader where to find the details: “see the run log”. A pointer, in a feed built for being read, to a file that had never existed. The 89 complaints were the better failure. They were at least complaints.

The fix resolves the path instead of assuming it. An automation tries the conventional file first; if the write is refused it falls to a state directory the sandbox leaves visible, the same directory the tool watch had moved its own state file to the day before, for the same reason. Resolution is by attempt rather than prediction, because only a real write knows what the sandbox permits, and the winner is cached per job so every line of one run lands in one file. The status event now names the file it actually used. It was proven under the real mask: a throwaway unit carrying the same restriction ran the tool watch’s dry sweep, and its lines landed in the fallback directory where before they had landed nowhere.

What the number changed is small and exact. A convention about where logs go became a resolver that finds out. The 89 complaints were addressed to nobody; the pointer was addressed to everybody and pointed at nothing; and now a reader who follows “see the run log” arrives somewhere.


← all writing