Linux administrator reviewing systemd ExecCondition results and skipped ExecStart commands in a terminal.

Why systemd ExecCondition Can Skip Work Without Failing

Wed, Nov 25, 2026

An administrator can find a service with no current main-output file, an inactive state, and no failed unit, and still be looking at exactly the behavior systemd was configured to produce. ExecCondition= has a deliberately unusual boundary: by default, an exit status from 1 through 254 stops later startup commands without marking the unit failed; exit 255 or abnormal termination instead makes startup fail. A zero status, or a status explicitly accepted with SuccessExitStatus=, allows startup to continue. ExecCondition= runs before ExecStartPre=. These rules have existed since systemd 243.

That mechanism is useful only after the owner decides what the prerequisite means. Optional work may legitimately be skipped. Required work must not disappear behind a nonfailed state. The acceptance unit in this article is therefore one explicitly named manual --user service invocation, joined to its predicate process, actual ExecStart evidence, manager properties, ExecStopPost record, and uniquely attributable OnFailure observation.

The semantic baseline is the historical systemd 257.13 documentation, not a claim that 257.13 is current. The versioned systemd.service, systemd.exec, systemctl, systemd.unit, org.freedesktop.systemd1, and journalctl manuals were accessed November 25, 2026. The CPython 3.13.3 release page identifies that release as April 8, 2025; it says nothing about systemd semantics.

The requested VM baseline was not installed, and this fixture was not executed. No hashes, timestamps, invocation IDs, command statuses, case passes, or observed outputs below are fabricated. Every E01–E10 observation remains NOT EXECUTED / HOLD until an owned disposable VM produces and preserves the evidence.

1. Define what an approved prerequisite outcome means

Start with policy, not systemctl status.

Prerequisite policy

Permitted outcome

Unacceptable outcome

Acceptance evidence

Optional work

Predicate says “not applicable”; main command does not run; unit does not enter failed state

Predicate uncertainty represented as an approved skip

Current predicate record, Result=exec-condition, no current main payload, post record, no attributed failure transition

Required work

Prerequisite succeeds and current main executes successfully

Main silently skipped because a 1–254 predicate result was treated as optional

Current main payload plus command execution state, or an explicit blocking failure if prerequisite is false

Required prerequisite currently false

Startup fails visibly

Unit settles nonfailed without required work

Failure state/result, failed precheck or condition status, post record and attributed OnFailure record

The distinction is built into the systemd.service manual: ExecCondition= status 1–254 skips remaining startup commands without failing the unit, whereas 255 or abnormal termination fails it. A condition status of zero or a configured SuccessExitStatus= continues. OnFailure= is a different boundary: the systemd.unit manual says its listed units are activated when the source unit enters the failed state.

Consequently, “not failed” and “the main command executed” are different propositions. A Type=oneshot service without RemainAfterExit=yes normally returns to an inactive/dead state after a successful run, so an inactive state alone cannot distinguish successful execution from a condition skip.

This investigation also stays separate from application readiness before dependent startup. That prior article examines when another service may safely consume application functionality; this fixture asks an earlier question: did the prerequisite permit ExecStart to begin at all?

Finally, even a demonstrated main execution proves only this synthetic local command ran. It does not establish external delivery, database commit, backup validity, transaction completion, or exactly-once business effects.

systemd-img-first

2. Freeze the user manager and executable baseline

Use one ordinary account on one owned disposable Linux VM. Every service-manager operation in this protocol uses --user. If the user bus is unavailable, do not fall back to system-wide units merely to obtain a result. That is a different manager and a different qualification.

The same principle appears in the separate discussion of persistent timer catch-up evidence: the presence of a systemctl binary is not evidence that the intended user manager exists or has the required identity. The systemctl manual confirms that systemctl show with no unit argument queries manager properties, while the systemd D-Bus API reference documents the manager D-Bus object separately from unit objects.

No enablement, boot changes, clock manipulation, system-wide unit changes, timers, sockets, automatic restart policy, or production services belong in this fixture.

Identify the running manager separately from its client

Capture the client and manager independently:

run_root="$HOME/.local/state/xec-qualification"
mkdir -p "$run_root"

date -u +%Y-%m-%dT%H:%M:%SZ >"$run_root/boundary-start.utc"

systemctl --version \
  >"$run_root/systemctl-client.txt" 2>"$run_root/systemctl-client.stderr"
printf '%s\n' "$?" >"$run_root/systemctl-client.exit"

systemctl --user show --property=Version --all \
  >"$run_root/user-manager-version.txt" 2>"$run_root/user-manager-version.stderr"
printf '%s\n' "$?" >"$run_root/user-manager-version.exit"

python3 --version \
  >"$run_root/python-version.txt" 2>&1

cat /etc/os-release >"$run_root/os-release.txt"
uname -a >"$run_root/uname.txt"

The systemctl manual documents both manager show behavior and --all, which retains otherwise empty properties. The documentation header saying “systemd 257.13” is not runtime evidence.

The qualification target is a running user manager identifying the intended 257.13 baseline, a separately recorded systemctl client from that baseline, and CPython 3.13.3. The Python release page records 3.13.3 as the third 3.13 maintenance release, published April 8, 2025. A different manager, client, or interpreter is not automatically wrong, but it is a different qualification and should be RERUN only after its changed baseline is explicitly reviewed.

Record distribution packaging as evidence rather than guessing:

if command -v dpkg-query >/dev/null; then
    dpkg-query -W -f='${Package}\t${Version}\n' systemd python3 python3.13 \
      >"$run_root/package-builds.txt" 2>"$run_root/package-builds.stderr" || :
elif command -v rpm >/dev/null; then
    rpm -q systemd python3 \
      >"$run_root/package-builds.txt" 2>"$run_root/package-builds.stderr" || :
else
    printf '%s\n' 'package query mechanism not identified' \
      >"$run_root/package-builds.txt"
fi

Freeze absolute paths and source identities

Resolve executable paths once and hash the actual bytes used:

systemctl_bin="$(readlink -f "$(command -v systemctl)")"
python_bin="$(readlink -f "$(command -v python3)")"
systemd_bin="$(readlink -f "$(command -v systemd)")"

printf '%s\n' \
  "SYSTEMCTL_BIN=$systemctl_bin" \
  "PYTHON_BIN=$python_bin" \
  "SYSTEMD_BIN=$systemd_bin" \
  >"$run_root/executable-paths.txt"

sha256sum "$systemctl_bin" "$python_bin" "$systemd_bin" \
  >"$run_root/executable-sha256.txt"

A SHA-256 recorded for a file identifies those bytes; it does not certify every executable installed on the VM.

After creating or changing unit files, run systemctl --user daemon-reload. The systemctl manual says daemon-reload reloads unit files and recreates the manager dependency tree, and separately warns that systemctl cat shows disk files that can differ from the manager's currently loaded understanding if reload has not occurred.

Capture both disk and manager views. The systemd D-Bus API reference defines FragmentPath as the unit fragment from which a unit was loaded and exposes DropInPaths; the systemctl manual says show properties are normalized and include both configuration and runtime state.

3. Build a fixture that records each lifecycle command

Use fresh unit names for every case and run. Do not rely on the shell's working directory. The generated units use absolute interpreter, helper, input, event, and payload paths. They are Type=oneshot, RemainAfterExit=no, Restart=no, and have finite start/stop bounds.

The absolute-path discipline serves the same purpose as the separate procedure to verify which Bash executable is selected: executable identity must be evidence, not an assumption produced by name lookup.

Record predicate, main and stop phases independently

The standard-library-only helper is complete:

#!/usr/bin/env python3
# event.py
import argparse, json, os, signal, time
from pathlib import Path

def append(path, row):
    p = Path(path)
    p.parent.mkdir(parents=True, exist_ok=True)
    with p.open("a", encoding="utf-8") as f:
        json.dump(row, f, sort_keys=True, separators=(",", ":"))
        f.write("\n")
        f.flush()
        os.fsync(f.fileno())

def envfield(name):
    return {"set": name in os.environ, "value": os.environ.get(name)}

def base(a):
    return {
        "schema": 1,
        "case_id": a.case,
        "run_id": a.run,
        "fixture_revision": a.revision,
        "invocation_id": os.environ.get("INVOCATION_ID"),
        "pid": os.getpid(),
        "phase": a.phase,
        "time_ns": time.time_ns(),
    }

def read_behavior(path):
    return json.loads(Path(path).read_text(encoding="utf-8"))

def main():
    p = argparse.ArgumentParser()
    p.add_argument("mode", choices=("condition", "main", "post", "observer"))
    p.add_argument("--case", required=True)
    p.add_argument("--run", required=True)
    p.add_argument("--revision", required=True)
    p.add_argument("--phase", required=True)
    p.add_argument("--event-file")
    p.add_argument("--behavior-file")
    p.add_argument("--payload-file")
    p.add_argument("--control-file")
    p.add_argument("--failure-file")
    a = p.parse_args()
    row = base(a)

    if a.mode == "condition":
        behavior = read_behavior(a.behavior_file)
        row["selected_behavior"] = behavior
        row["behavior_file"] = str(Path(a.behavior_file).resolve())
        append(a.event_file, row)
        if behavior.get("signal") == "SIGKILL":
            os.kill(os.getpid(), signal.SIGKILL)
        raise SystemExit(int(behavior["exit_code"]))

    if a.mode == "main":
        append(a.event_file, row)
        payload = {
            "case_id": a.case, "run_id": a.run,
            "fixture_revision": a.revision,
            "invocation_id": os.environ.get("INVOCATION_ID"),
            "payload": "synthetic-current-run-main"
        }
        with Path(a.payload_file).open("w", encoding="utf-8") as f:
            json.dump(payload, f, sort_keys=True, separators=(",", ":"))
            f.write("\n")
            f.flush()
            os.fsync(f.fileno())
        return

    if a.mode == "post":
        row["service_result"] = envfield("SERVICE_RESULT")
        row["exit_code"] = envfield("EXIT_CODE")
        row["exit_status"] = envfield("EXIT_STATUS")
        append(a.event_file, row)
        return

    row["monitor_unit"] = envfield("MONITOR_UNIT")
    row["monitor_invocation_id"] = envfield("MONITOR_INVOCATION_ID")
    row["monitor_service_result"] = envfield("MONITOR_SERVICE_RESULT")
    row["monitor_exit_code"] = envfield("MONITOR_EXIT_CODE")
    row["monitor_exit_status"] = envfield("MONITOR_EXIT_STATUS")
    target = a.failure_file if row["monitor_unit"]["set"] else a.control_file
    append(target, row)

if name == "__main__":
    main()

For the SIGKILL case, the helper closes and synchronizes its event before signaling itself. The event records the intended behavior. It does not establish the manager's actual classification; that comes from the manager's command-status record.

The generator creates the behavior inputs, source units, unique observers, and independent literal manifest:

#!/usr/bin/env python3
# make_fixture.py
import argparse, json
from pathlib import Path

CASES = {
 "E01":("condition",[0],"r1"),
 "E02":("condition",[1],"r1"),
 "E03":("condition",[254],"r1"),
 "E04":("condition",[255],"r1"),
 "E05":("condition",["SIGKILL"],"r1"),
 "E06":("condition",[42],"r1"),
 "E07":("pre",[1],"r1"),
 "E08":("condition",[0,1,0],"r1"),
 "E09":("condition",[1],"r1"),
 "E10":("pre",[0],"r2"),
}

def q(s): return json.dumps(str(s))
def cmd(py, helper, xs):
    return " ".join(q(x) for x in (py, helper, xs))

ap=argparse.ArgumentParser()
ap.add_argument("--run-root",required=True)
ap.add_argument("--run-id",required=True)
ap.add_argument("--python",required=True)
ap.add_argument("--helper",required=True)
ap.add_argument("--unit-dir",required=True)
a=ap.parse_args()

root=Path(a.run_root).resolve()
udir=Path(a.unit_dir).resolve()
udir.mkdir(parents=True,exist_ok=True)
(root/"units").mkdir(parents=True,exist_ok=True)
manifest={"run_id":a.run_id,"cases":{}}

for cid,(placement,behaviors,rev) in CASES.items():
    cdir=root/"cases"/cid
    cdir.mkdir(parents=True,exist_ok=True)
    unit=f"xec-{a.run_id}-{cid.lower()}.service"
    obs=f"xec-{a.run_id}-{cid.lower()}-failure.service"
    cond=[]
    for n,b in enumerate(behaviors,1):
        bf=cdir/f"behavior-{n}.json"
        data={"signal":"SIGKILL"} if b=="SIGKILL" else {"exit_code":b}
        bf.write_text(json.dumps(data,sort_keys=True)+"\n")
        phase=f"predicate-{n}"
        line=cmd(a.python,a.helper,"condition","--case",cid,"--run",a.run_id,
                 "--revision",rev,"--phase",phase,"--event-file",
                 cdir/f"{phase}.jsonl","--behavior-file",bf)
        directive="ExecStartPre" if placement=="pre" else "ExecCondition"
        cond.append(f"{directive}={line}")

    maincmd=cmd(a.python,a.helper,"main","--case",cid,"--run",a.run_id,
                "--revision",rev,"--phase","main","--event-file",
                cdir/"main.jsonl","--payload-file",cdir/"main-payload.json")
    postcmd=cmd(a.python,a.helper,"post","--case",cid,"--run",a.run_id,
                "--revision",rev,"--phase","post","--event-file",cdir/"post.jsonl")
    extra="SuccessExitStatus=42\n" if cid=="E06" else ""
    text=f"""[Unit]
Description=xec fixture {cid}
OnFailure={obs}

[Service]
Type=oneshot
RemainAfterExit=no
Restart=no
TimeoutStartSec=10s
TimeoutStopSec=10s
{chr(10).join(cond)}
{extra}ExecStart={maincmd}
ExecStopPost={postcmd}
"""
    observercmd=cmd(a.python,a.helper,"observer","--case",cid,"--run",a.run_id,
        "--revision",rev,"--phase","observer","--control-file",
        cdir/"observer-control.jsonl","--failure-file",cdir/"observer-failure.jsonl")
    obstext=f"""[Service]
Type=oneshot
RemainAfterExit=no
Restart=no
TimeoutStartSec=10s
ExecStart={observercmd}
"""
    for name,data in ((unit,text),(obs,obstext)):
        (root/"units"/name).write_text(data)
        (udir/name).write_text(data)
    manifest["cases"][cid]={
        "revision":rev,"unit":unit,"observer":obs,
        "case_dir":str(cdir),"placement":placement,"behaviors":behaviors
    }

(root/"manifest.json").write_text(json.dumps(manifest,indent=2,sort_keys=True)+"\n")

The generated source-unit shape is therefore literal rather than conceptual:

[Unit]
Description=xec fixture E02
OnFailure=xec-RUNID-e02-failure.service

[Service]
Type=oneshot
RemainAfterExit=no
Restart=no
TimeoutStartSec=10s
TimeoutStopSec=10s
ExecCondition=/ABS/PYTHON /ABS/event.py condition ... --behavior-file /ABS/behavior-1.json
ExecStart=/ABS/PYTHON /ABS/event.py main ... --payload-file /ABS/main-payload.json
ExecStopPost=/ABS/PYTHON /ABS/event.py post ...

The real generated file contains no RUNID or /ABS/ placeholder; the generator rejects that problem by materializing actual absolute values.

Give every failure observer its own identity

The systemd.exec manual defines MONITOR_UNIT and MONITOR_INVOCATION_ID for services activated through OnFailure= or OnSuccess= and warns that when multiple source services share one handler, those fields are not passed. That is why every source unit above gets a distinct observer.

Before interpreting an absent attributed observer record, the runner manually starts that case's observer once. With no monitor environment, the helper writes observer-control.jsonl; an actual OnFailure= activation writes observer-failure.jsonl. Thus absence means something only after the recorder itself has demonstrated that it can execute.

The runner is:

#!/usr/bin/env bash
# run_fixture.sh
set -u
umask 077

self_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)"
run_id="$(python3 -c 'import secrets;print(secrets.token_hex(6))')"
root="$HOME/.local/state/xec-$run_id"
unit_dir="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
mkdir -p "$root"

python_bin="$(readlink -f "$(command -v python3)")"
systemctl_bin="$(readlink -f "$(command -v systemctl)")"
helper="$self_dir/event.py"

date -u +%Y-%m-%dT%H:%M:%SZ >"$root/run-start.utc"
"$systemctl_bin" --version >"$root/systemctl-client.txt" 2>&1
"$systemctl_bin" --user show --property=Version --all \
  >"$root/manager.txt" 2>"$root/manager.stderr"
printf '%s\n' "$?" >"$root/manager.exit"
"$python_bin" --version >"$root/python.txt" 2>&1
cat /etc/os-release >"$root/os-release.txt"
uname -a >"$root/uname.txt"

grep -q '257\.13' "$root/systemctl-client.txt" || { echo HOLD >"$root/qualification"; exit 3; }
grep -q '257\.13' "$root/manager.txt" || { echo HOLD >"$root/qualification"; exit 3; }
grep -q 'Python 3\.13\.3' "$root/python.txt" || { echo HOLD >"$root/qualification"; exit 3; }

sha256sum "$python_bin" "$systemctl_bin" "$helper" \
  "$self_dir/make_fixture.py" "$self_dir/check_fixture.py" "$0" \
  >"$root/source-and-executable-sha256.txt"

"$python_bin" "$self_dir/make_fixture.py" \
  --run-root "$root" --run-id "$run_id" --python "$python_bin" \
  --helper "$helper" --unit-dir "$unit_dir" || exit 3

sha256sum "$root"/units/*.service >"$root/unit-source-sha256.txt"
"$systemctl_bin" --user daemon-reload || { echo HOLD >"$root/qualification"; exit 3; }

for cid in E01 E02 E03 E04 E05 E06 E07 E08 E09 E10; do
  case_dir="$root/cases/$cid"
  unit="$(python_bin="$python_bin" "$python_bin" - "$root/manifest.json" "$cid" <<'PY'
import json,sys
print(json.load(open(sys.argv[1]))["cases"][sys.argv[2]]["unit"])
PY
)"
  observer="${unit%.service}-failure.service"

  date -u +%Y-%m-%dT%H:%M:%SZ >"$case_dir/start.utc"
  "$systemctl_bin" --user cat "$unit" >"$case_dir/unit.cat"
  "$systemctl_bin" --user show --all "$unit" \
    -p FragmentPath -p DropInPaths -p ActiveState -p SubState -p Result \
    -p InvocationID -p ExecCondition -p ExecStartPre -p ExecStart \
    -p ExecStopPost -p ExecMainStartTimestamp -p ExecMainExitTimestamp \
    -p ExecMainPID -p ExecMainCode -p ExecMainStatus \
    >"$case_dir/show.before"

  "$systemctl_bin" --user start "$observer" \
    >"$case_dir/observer-control.stdout" 2>"$case_dir/observer-control.stderr"
  printf '%s\n' "$?" >"$case_dir/observer-control.exit"

  if [ "$cid" = E09 ]; then
    printf '%s\n' \
      '{"case_id":"E09","run_id":"OLD","fixture_revision":"old","invocation_id":"stale","payload":"synthetic-current-run-main"}' \
      >"$case_dir/main-payload.json"
  fi

  "$systemctl_bin" --user start "$unit" \
    >"$case_dir/start.stdout" 2>"$case_dir/start.stderr"
  printf '%s\n' "$?" >"$case_dir/start.exit"

  deadline=$((SECONDS+10))
  while "$systemctl_bin" --user list-jobs --no-legend |
        grep -F -e "$unit" -e "$observer" >/dev/null; do
    [ "$SECONDS" -lt "$deadline" ] || { echo HOLD >"$case_dir/job-reconcile"; break; }
    sleep 0.1
  done
  : >"${case_dir}/job-reconcile.ok"

  "$systemctl_bin" --user show --all "$unit" \
    -p FragmentPath -p DropInPaths -p ActiveState -p SubState -p Result \
    -p InvocationID -p ExecCondition -p ExecStartPre -p ExecStart \
    -p ExecStopPost -p ExecMainStartTimestamp -p ExecMainExitTimestamp \
    -p ExecMainPID -p ExecMainCode -p ExecMainStatus \
    >"$case_dir/show.final"

  "$systemctl_bin" --user show --all "$observer" \
    -p ActiveState -p SubState -p Result -p InvocationID -p ExecStart \
    >"$case_dir/observer.show.final"

  date -u +%Y-%m-%dT%H:%M:%SZ >"$case_dir/end.utc"
  journalctl --user -u "$unit" -u "$observer" --no-pager -o export \
    --since="$(cat "$case_dir/start.utc")" --until="$(cat "$case_dir/end.utc")" \
    >"$case_dir/journal.export" 2>"$case_dir/journal.stderr"
  printf '%s\n' "$?" >"$case_dir/journal.exit"
done

date -u +%Y-%m-%dT%H:%M:%SZ >"$root/run-end.utc"
printf '%s\n' NOT_CHECKED >"$root/qualification"
printf '%s\n' "$root"

A bounded job reconciliation is preferable to treating an arbitrary sleep as synchronization. The journal remains corroborating evidence, not an execution oracle: the journalctl manual supports structured filtering and export, while journal visibility depends on what records are accessible to the calling user.

The literal case manifest is:

Case

Controlled change

Expected evidence

Policy role

E01

One condition exits 0

Current main payload; successful result; oneshot settles inactive

Positive execution control

E02

Condition exits 1

No current main; exec-condition result; not failed; post record; no failure observer

Optional-skip boundary

E03

Condition exits 254

Same skip classification at upper default bound

Boundary control

E04

Condition exits 255

No main; failed/exit-code; post and attributed failure observer

Failure positive control

E05

Predicate terminates itself with SIGKILL

No main; failed/signal; post and attributed failure observer

Abnormal-exit control

E06

Condition exits 42; SuccessExitStatus=42

Current main executes; accepted condition status retained

Explicit override control

E07

Put exit-1 helper in ExecStartPre instead

No main; required precheck fails; failure evidence retained

Compare blocking policy

E08

Conditions return 0, 1, 0 in sequence

First two execute; third and main do not

Serial short-circuit

E09

Preseed an old main marker; current condition exits 1

Current skip; old run/invocation cannot satisfy completion

Evidence negative control

E10

Repair E07's synthetic prerequisite to 0 under a new revision

New invocation executes main; earlier failure remains archived

Recovery comparison

Every observed column is intentionally absent: NOT EXECUTED.

4. Establish successful execution before interpreting absence

Run E01 first. The systemd.service manual says a zero ExecCondition= result continues into later startup commands. For this fixture, E01 must therefore produce all of the following before any negative case is trusted: one current predicate event, one current main event, the exact current-run payload, one post record, manager evidence for the executed condition and ExecStart, and a successful final result.

Type=oneshot without RemainAfterExit=yes then normally settles inactive after its action finishes. That same high-level state can also be reached by a nonfailing condition skip. Consequently, neither inactive nor a default-looking MainPID=0 or ExecMainStatus=0 establishes execution.

The expected ordering is predicate → main → post. INVOCATION_ID must match across the helper records belonging to the source invocation. The systemd.exec manual defines $INVOCATION_ID as the invocation identifier supplied to unit processes. The systemd D-Bus API reference separately exposes main-process timestamps, PID, code, status, and configured command arrays, so configuration and populated execution status must not be conflated.

If E01 cannot establish that chain, all later claims about missing main execution are HOLD.

5. Exercise both ends of the optional-skip range

E02 and E03 probe the documented default range directly. The systemd.service manual states that status 1 through 254, inclusive, stops remaining commands and does not mark the unit failed. The systemd.exec manual names the corresponding service result exec-condition.

E02 therefore predicts: predicate event with intended status 1; actual ExecCondition command record showing that termination status; no current ExecStart event; no current main payload; Result=exec-condition; a post record; and no attributed OnFailure record. E03 repeats the same classification at 254, proving the upper edge rather than extrapolating from status 1.

The systemd.service manual also explicitly says ExecCondition= nonzero or abnormal outcomes invoke ExecStopPost=. A post record therefore proves that post hook executed. It does not prove ExecStart executed.

There is a documentary tension worth preserving. The systemd.exec manual's prose says $EXIT_CODE and $EXIT_STATUS contain information about the service's identified main process and are set only if the manager started and identified that process. Yet its summary table includes an exec-condition row with exited and statuses 1–254. Do not erase this inconsistency by assuming either presentation is universally authoritative for a skipped invocation. Preserve the raw environment as set/unset, and obtain the predicate's actual status from the per-command ExecCondition execution property plus its recorder event.

The application policy decides whether the mechanics are acceptable. For optional work, E02/E03 can represent an approved skip. For required work, the identical result is evidence that the unit policy is wrong: the absence of failure does not excuse missing required execution.

The separately captured systemctl start return code remains useful client evidence, but documentation of the unit-state boundary does not justify inventing one universal CLI exit code for every skipped-condition scenario.

6. Make the condition fail instead of skipping

E04 changes only the predicate result to 255. Under the systemd.service manual, 255 is outside the nonfailing skip range and makes the service fail. Expected evidence is therefore no main event, failed state, Result=exit-code, a post record, and a uniquely attributed failure observer.

E05 instead has the helper write and synchronize its predicate event, then send SIGKILL to itself. The systemd.service manual classifies abnormal condition termination (including signal termination) as failure. The systemd.exec manual distinguishes the signal service result from exit-code.

Do not reinterpret a signal as shell arithmetic such as 128+9. The manager's per-command execution information and service result are the evidence. E04 tests a numeric exit of 255; E05 tests an actual signal.

The expected observer record must contain the source unit and source invocation in MONITOR_UNIT and MONITOR_INVOCATION_ID, while its ordinary INVOCATION_ID is the observer's own invocation. That separation is defined by the systemd.exec manual.

Only after the observer's manual control record succeeds should absence of an attributed failure record in E02/E03 be meaningful.

7. Test the accepted-exit override as an explicit policy

E06 exits 42 from ExecCondition= and configures:

SuccessExitStatus=42

The systemd.service manual says condition results matching SuccessExitStatus= continue to the next command, and separately explains that SuccessExitStatus= changes how a numeric termination is treated without changing the number itself.

The prediction is therefore not “the predicate returned zero.” The helper event should still record selected status 42, and the manager's ExecCondition execution record should retain the actual process status. ExecStart should nevertheless run and produce a current payload.

This is an explicit policy override. It does not prove that 42 represents a valid prerequisite in the application domain. If the owner says 42 means “required resource corrupt,” adding it to SuccessExitStatus= would merely turn a blocking error into continuation.

The generator includes this setting only in E06. The loaded SuccessExitStatus behavior must be traceable to the corresponding unit bytes and manager configuration before the case can be accepted.

8. Compare an optional predicate with a required precheck

E07 uses the same synthetic exit-1 behavior in ExecStartPre= rather than ExecCondition= and leaves accepted-exit overrides empty.

That placement changes the policy boundary. The systemd.service manual characterizes ExecCondition= as a hybrid resembling ExecStartPre= but with the special 1–254 nonfailure skip range. A failed ExecStartPre= instead causes startup to fail unless its failure is otherwise ignored.

The E07 prediction is thus no main payload, failed state, retained ExecStartPre status 1, Result=exit-code, post evidence, and an attributed failure observer.

For a prerequisite whose false result means “required work must not proceed and operators must see a failure,” that failure boundary is often the better policy representation. For a prerequisite whose false result means “nothing applicable this time,” ExecCondition= may be appropriate.

This comparison makes no claim about dependent-service readiness, ordering correctness, or application health. It establishes only the startup policy of this source invocation.

9. Prove where a condition sequence stops

E08 configures three ExecCondition= commands with synthetic results 0, 1, and 0.

The systemd.service manual says multiple conditions execute serially, and a 1–254 result skips the remaining commands. Therefore the expected recorder sequence contains predicate-1 and predicate-2 only. Predicate-3 and ExecStart must have no current events.

The loaded manager configuration should still contain all three commands. The systemd D-Bus API reference exposes ExecCondition and ExecConditionEx arrays as service properties. That creates an important evidence distinction: configured does not mean executed.

The checker must therefore compare the manager's three configured commands with the two current predicate events and the execution-status content of the manager property. If predicate-3 or main produces current evidence, the fixture contradicts its prediction. Do not “fix” the expectation after seeing an unexpected result; mark the case HOLD and investigate the baseline, unit bytes, loaded configuration, and attribution.

10. Reject a completion marker from an earlier invocation

E09 deliberately places a plausible-looking main-payload.json in the case directory before startup. Its run_id, revision, and invocation are stale.

The current condition then exits 1, so the authored prediction is an optional skip and no current main execution. The stale payload must remain in place: deleting it before the test destroys the negative control.

A checker that merely asks whether main-payload.json exists will falsely report completion. A valid checker must compare at least case ID, run ID, fixture revision, source invocation ID, current main event, and manifest identity.

This is why INVOCATION_ID matters operationally. The systemd.exec manual supplies it to unit processes, and the systemd D-Bus API reference exposes unit invocation identity through manager state.

If original evidence for real work has already been lost, do not reconstruct a fictitious invocation ID or synthesize a completion record. The correct state is unknown, which maps to HOLD.

11. Reconcile manager state with the evidence bundle

An aggregate status screen is insufficient. The same discipline used to establish which validation steps actually ran applies here: coverage of an intended command and evidence of its execution are distinct claims.

For each source unit, preserve this exact manager capture before reset or cleanup:

systemctl --user show --all "$unit" \
  --property=FragmentPath \
  --property=DropInPaths \
  --property=ActiveState \
  --property=SubState \
  --property=Result \
  --property=InvocationID \
  --property=ExecCondition \
  --property=ExecStartPre \
  --property=ExecStart \
  --property=ExecStopPost \
  --property=ExecMainStartTimestamp \
  --property=ExecMainExitTimestamp \
  --property=ExecMainPID \
  --property=ExecMainCode \
  --property=ExecMainStatus

The systemctl manual specifically recommends show for computer-parsable property output and says --all prevents empty properties from being suppressed. The systemd D-Bus API reference documents ExecCondition, ExecStartPre, and ExecStart as arrays containing command execution information, while the ExecMain* fields describe the main process as far as known.

The evidence schema is:

Record

Required fields

Baseline

UTC boundaries, manager Version, systemctl version, Python version, /etc/os-release, kernel, package/build records

Identity

run ID, case ID, fixture revision, source unit, observer unit

Source bytes

complete unit files, behavior inputs, helper/generator/runner/checker hashes

Loaded definition

FragmentPath, DropInPaths, systemctl cat, normalized execution properties

Client call

systemctl start stdout, stderr, exit status

Manager state

ActiveState, SubState, Result, source InvocationID

Command execution

ExecCondition, ExecStartPre, ExecStart, ExecStopPost arrays

Main process

start/exit timestamps, PID, code, status

Local events

predicate, main, post JSONL and exact payload

Failure observer

control record, observer invocation, MONITOR_* source attribution

Journal

scoped export plus journal command exit status

The JSONL event schema is intentionally small:

{
  "schema": 1,
  "case_id": "E02",
  "run_id": "NOT_EXECUTED_EXAMPLE",
  "fixture_revision": "r1",
  "invocation_id": "NOT_EXECUTED_EXAMPLE",
  "pid": 0,
  "phase": "post",
  "time_ns": 0,
  "service_result": {"set": true, "value": "exec-condition"},
  "exit_code": {"set": false, "value": null},
  "exit_status": {"set": false, "value": null}
}

That record is an example schema only; NOT EXECUTED.

Structured journal capture can use:

journalctl --user -u "$unit" -u "$observer" \
  --since="$case_start" --until="$case_end" \
  --no-pager --output=export >journal.export

The journalctl manual says -u/--user-unit filter journal records by units and that export produces a structured stream suitable for preservation. Journal absence alone, however, is not evidence that a command never executed.

Attribute command results to the correct process

Join run_id + case_id + revision + unit + InvocationID. A post-hook record with the source invocation proves that post hook ran. It does not prove main ran.

The independent checker can enforce those joins:

#!/usr/bin/env python3
# check_fixture.py
import json, re, sys
from pathlib import Path

root=Path(sys.argv[1]).resolve()
m=json.loads((root/"manifest.json").read_text())
errors=[]

def rows(p):
    if not p.exists(): return []
    return [json.loads(x) for x in p.read_text().splitlines() if x.strip()]

def props(p):
    out={}
    for line in p.read_text().splitlines():
        k,sep,v=line.partition("=")
        if sep: out[k]=v
    return out

def require(ok,msg):
    if not ok: errors.append(msg)

expected={
"E01":("inactive","success",1,0),
"E02":("inactive","exec-condition",0,0),
"E03":("inactive","exec-condition",0,0),
"E04":("failed","exit-code",0,1),
"E05":("failed","signal",0,1),
"E06":("inactive","success",1,0),
"E07":("failed","exit-code",0,1),
"E08":("inactive","exec-condition",0,0),
"E09":("inactive","exec-condition",0,0),
"E10":("inactive","success",1,0),
}

for cid,data in m["cases"].items():
    d=Path(data["case_dir"])
    p=props(d/"show.final")
    active,result,main_n,fail_n=expected[cid]
    require(p.get("ActiveState")==active,f"{cid}: ActiveState")
    require(p.get("Result")==result,f"{cid}: Result")
    inv=p.get("InvocationID","")
    require(bool(inv),f"{cid}: missing source InvocationID")

    main=rows(d/"main.jsonl")
    require(len(main)==main_n,f"{cid}: main event count")
    for r in main:
        require(r["run_id"]==m["run_id"] and r["case_id"]==cid,
                f"{cid}: stale main event")
        require(r["fixture_revision"]==data["revision"],
                f"{cid}: wrong main revision")
        require(r["invocation_id"]==inv,f"{cid}: main invocation mismatch")

    post=rows(d/"post.jsonl")
    require(len(post)==1,f"{cid}: post event count")
    if post:
        require(post[0]["invocation_id"]==inv,f"{cid}: post invocation mismatch")
        require(post[0]["service_result"]["value"]==result,
                f"{cid}: SERVICE_RESULT mismatch")

    ctrl=rows(d/"observer-control.jsonl")
    require(len(ctrl)==1,f"{cid}: observer control missing")

    fail=rows(d/"observer-failure.jsonl")
    require(len(fail)==fail_n,f"{cid}: failure observer count")
    for r in fail:
        require(r["monitor_unit"]["value"]==data["unit"],
                f"{cid}: MONITOR_UNIT mismatch")
        require(r["monitor_invocation_id"]["value"]==inv,
                f"{cid}: MONITOR_INVOCATION_ID mismatch")

    payload=d/"main-payload.json"
    if main_n:
        require(payload.exists(),f"{cid}: missing current payload")
        if payload.exists():
            x=json.loads(payload.read_text())
            require(x.get("run_id")==m["run_id"],f"{cid}: stale payload run")
            require(x.get("fixture_revision")==data["revision"],
                    f"{cid}: stale payload revision")
            require(x.get("invocation_id")==inv,
                    f"{cid}: stale payload invocation")
    elif cid=="E09":
        require(payload.exists(),f"{cid}: negative-control marker removed")
        if payload.exists():
            x=json.loads(payload.read_text())
            require(x.get("run_id")!=m["run_id"],
                    f"{cid}: stale marker incorrectly current")
    else:
        require(not payload.exists(),f"{cid}: unexpected main payload")

    if cid=="E08":
        require(len(rows(d/"predicate-1.jsonl"))==1,"E08: predicate-1")
        require(len(rows(d/"predicate-2.jsonl"))==1,"E08: predicate-2")
        require(len(rows(d/"predicate-3.jsonl"))==0,"E08: predicate-3 ran")

    raw=(d/"show.final").read_text()
    if cid=="E06":
        require(re.search(r"status=42\b",raw) is not None,
                "E06: manager did not retain condition status 42")

if errors:
    print("HOLD")
    for e in errors: print(e)
    raise SystemExit(2)

print("MECHANICS_MATCH_EXPECTATIONS")
print("Application policy decision still requires owner review.")

This checker intentionally does not derive the predicate status from post-hook $EXIT_CODE/$EXIT_STATUS, because of the prose/table tension in the systemd.exec manual. It uses the condition's own event plus manager execution properties instead.

Inactive units can eventually be garbage-collected from memory; the systemd.unit manual notes inactive units may be unloaded when no longer referenced, while failed-state retention differs. Capture properties promptly rather than attempting later reconstruction. Missing, duplicated, stale, contradictory, or unattributable current-cycle evidence is HOLD.

12. Repair, repeat and restore the owned fixture

E10 is the planned comparison with E07. The required-work policy remains unchanged; the synthetic prerequisite input changes from exit 1 to exit 0 under revision r2, and a fresh unique unit/invocation is used.

Expected E10 evidence is a successful ExecStartPre, a current main event and payload, successful result, post record, and no attributed failure observer. The earlier E07 evidence stays archived. That makes recovery a comparison between two preserved invocations, not a rewrite of history.

This is distinct from the separate workflow to reconcile skipped configuration activation, where handler notification and configuration idempotence are the issue. Here, the repair changes a synthetic prerequisite outcome and repeats a systemd startup policy test.

Repeat E01 and the relevant failure controls after any material fixture change. A clean E10 does not retroactively make a malformed E07 record trustworthy.

Preserve the failure before clearing or removing it

The systemctl manual says reset-failed clears the failed state and retained exit status, so preserve evidence first. Likewise, a later daemon-reload affects the manager's view of future configuration; it does not alter effects already produced by completed commands. In this fixture, those effects are deliberately limited to synthetic local files.

Cleanup must refuse unexpected names and paths:

case "$root" in
  "$HOME"/.local/state/xec-*) ;;
  ) printf '%s\n' "refusing unexpected root: $root" >&2; exit 2 ;;
esac

case "$run_id" in
  ""|[!0-9a-f]*) printf '%s\n' "refusing invalid run id" >&2; exit 2 ;;
esac

archive="$HOME/xec-evidence-$run_id.tar"
tar -cf "$archive" -C "$(dirname "$root")" "$(basename "$root")"
sha256sum "$archive" >"$archive.sha256"

for unit_file in "$root"/units/*.service; do
    unit="$(basename "$unit_file")"
    case "$unit" in
      xec-"$run_id"-*.service) systemctl --user stop "$unit" || : ;;
      ) printf '%s\n' "refusing unit $unit" >&2; exit 2 ;;
    esac
done

for unit_file in "$root"/units/.service; do
    unit="$(basename "$unit_file")"
    rm -- "$unit_dir/$unit"
done

systemctl --user daemon-reload
systemctl --user list-jobs --no-legend |
    grep -F "xec-$run_id-" && {
        printf '%s\n' "owned jobs still present" >&2
        exit 2
    }

rm -rf -- "$root"

If failed-state preservation is needed for review, perform reset-failed only after the archive has been verified. A clean status display after reset is housekeeping evidence, not proof that recovery executed the required work.

13. Decide ACCEPT, REPAIR, RERUN or HOLD

The decision is not “did systemctl look green?” It is a combination of prerequisite policy, actual lifecycle evidence, baseline integrity, and attribution.

Situation

Evidence state

Decision

Owner

Next action

Optional prerequisite exits 1–254; current skip fully demonstrated

Complete and internally consistent

ACCEPT

Application owner + administrator

Record that nonexecution is approved policy

Required prerequisite succeeds and current main execution is proven

Complete and current

ACCEPT

Application owner + reviewer

Release only the tested execution claim

Required prerequisite implemented as optional 1–254 ExecCondition skip

Complete evidence shows main absent

REPAIR

Administrator with application owner

Change prerequisite policy or check semantics

SuccessExitStatus accepts a status the owner says should block

Configuration and runtime evidence complete

REPAIR

Administrator + application owner

Remove unjustified override

Recorder, observer control, attribution, or collector is defective

Evidence defect understood

REPAIR

Fixture administrator

Repair evidence collection before workload interpretation

Runtime, manager, Python, unit bytes, helper bytes, or fixture revision changes

Prior evidence belongs to previous baseline

RERUN

Administrator

Generate fresh run/case/invocation identities

Capture interrupted after configuration or runtime change

Incomplete current-cycle evidence

RERUN

Administrator

Repeat from a fresh identity; do not merge cycles

User manager unavailable or wrong baseline silently substituted

Qualification target not exercised

HOLD

Administrator

Restore correct environment or open a new qualification

Current InvocationID missing, stale marker accepted, observer attribution missing

Completion cannot be tied to invocation

HOLD

Independent reviewer

Preserve evidence; investigate

Manager state contradicts recorder or expected command sequence

Evidence conflict

HOLD

Independent reviewer

Resolve contradiction before policy decision

Any E01–E10 case in this article

NOT EXECUTED

HOLD

Commissioning owner

Run on specified owned VM and attach artifacts

The application owner assigns business meaning to predicate outcomes: “optional,” “required,” and the meaning of statuses such as 42. The Linux administrator owns the unit representation and the correctness of the fixture. Evidence review should be performed separately from both, because the reviewer must be willing to reject attractive but stale or incomplete completion evidence.

Release criteria are narrow. The user manager and interpreter baseline must be identified and accepted. Unit and source bytes must be hashed. FragmentPath, DropInPaths, and loaded command properties must correspond to the intended definition. E01 must prove the main recorder can work. Each observer must pass its manual control. Current predicate status must be attributable to the current source invocation. Required main execution must have both manager evidence and current local payload evidence. Expected failures must retain post and uniquely attributed observer records. E09 must prove that stale evidence is rejected. E10 must use fresh identities and preserve E07's prior failure.

The systemd.unit manual's OnFailure= rule supports one specific inference: an E02/E03 optional condition skip should not activate the failure handler because the source unit has not entered failed state; E04/E05 should activate it because those cases are predicted to fail. It does not prove application readiness or downstream success.

The systemd.exec manual's SERVICE_RESULT=exec-condition gives a useful manager classification for the 1–254 boundary, but because its EXIT_CODE/EXIT_STATUS prose and table are not perfectly aligned, acceptance must retain raw environment state and use the actual condition command record for predicate termination evidence.

The systemctl manual's normalized show output and the systemd D-Bus API reference's command arrays solve a different problem: they connect configuration and manager-observed command execution. The helper event then ties the process to run, case, revision, and invocation. Neither source alone is enough.

Most importantly, a negative control may pass every diagnostic assertion while exposing a workload policy that must be repaired. An E02-style skip can be mechanically perfect and still be unacceptable if the application owner says the work was required. The checker validates evidence consistency; it does not invent application policy.

Without execution evidence, that distinction produces only one responsible overall result: HOLD. The documentation supports the predictions, and the fixture is reproducible, but no systemd 257.13 user-manager invocation was executed here.

14. Develop the administration skills behind the decision

This kind of investigation depends less on memorizing one directive than on disciplined Linux administration: identifying the actual manager, freezing executable and configuration identity, separating process status from service policy, preserving failures before cleanup, and troubleshooting contradictory evidence.

Refonte Learning's System Administration Program is described as a six-month program at 10–12 hours per week covering Windows and Linux systems, installation and configuration, networking, security, troubleshooting, virtualization, backup and recovery, command-line work, cloud management, and a capstone; the page also describes practical projects, seasoned guidance, an educational mentor, and a Potential Internship, not guaranteed placement. It lists a Training Certificate and Certificate of Internship upon successful completion and gives career directions including system administrator, network administrator, and IT support specialist. Its requirements section asks for basic computer/network knowledge and says prior IT study is helpful but not required, while a separate admission section says applicants must be working toward a bachelor's or higher-level degree.

Coverage of specialized ExecCondition instruction, this exact laboratory, systemd 257.13, CPython 3.13.3, and a particular mentoring cadence is unconfirmed. A practical next step is to use the program's administration and troubleshooting foundations to practice the evidence discipline shown here on an owned disposable Linux environment.