About Professional
How I Build How I Build Meet the Team
Technology Homelab App Showcase Case Studies
Maverick & Luke Say Hello

Case study

Killing a Year-Long CI-Hang Bug Class with POSIX ACLs Across the Fleet

Replaced a fragile world-writable permissions hack (which had silently broken automated deploys across a fleet for over a year) with a self-healing POSIX-ACL model, piloting on one app to prove the mechanism before migrating the fleet, and shipping a daily detector for the exact failure the existing monitors were blind to.

The challenge

A development server runs a couple dozen web apps, each auto-deployed by a self-hosted CI runner (a dedicated deploy/runner user) that does git fetch && git reset --hard inside each app directory. The apps were owned by a regular user, but the runner needs to write .git during deploy. The historical fix was a recursive chmod granting world-write (o+w) across the whole app tree.

That fix was structurally unstable: new files inherit the creator's umask, which strips the world-write bit, so any file added after the chmod silently drifted back to non-writable, and the next deploy failed or hung. This bug class recurred for over a year across many apps. Its worst incarnation: one app sat silently frozen at an old commit for weeks (its CI job hung for minutes on the un-writable .git, blocking the single-slot runner) and no monitor caught it, because the uptime monitor sees liveness, not deploy freshness. An early audit found several more apps in the same latent state; their next push would have hung identically.

The real fix had been tracked but repeatedly deferred as "too big to do at once."

Approach

The core insight: reach for the right OS primitive. chmod's "other" class can't be scoped to one user and doesn't propagate to new files, while chown transfers ownership away from an app's own service user. POSIX ACLs solve both problems. They are additive (the owner keeps full access; the runner gets an explicit grant) and support a default ACL that new files inherit automatically:

`` setfacl -R -m u:runner:rwX <app> # immediate grant, scoped to the runner setfacl -R -d -m u:runner:rwX <app> # default ACL → new files inherit find … -exec chmod o-w {} + # drop the world-write crutch ``

The capital X is deliberate: it sets the execute bit only on directories, never flagging regular files executable, which would break git's mode tracking, a documented failure of naive chmod 777.

Results

What this demonstrates


A companion piece covers the earlier interim fix and the discovery of the silent deploy freeze that surfaced this work.