Commit 54e93d2
committed
FIX: %s belongs in parameters: only, never in command:
Root cause of "Bootstrap netboot.xyz does nothing" (and the silent
fetch_url failures): configd's base.py::_cmd_builder substitutes %s in
the action's parameters: template, then returns command + " " +
parameters. If command: ALSO has %s, that %s is concatenated literally
and shows up as an extra argv element to the script. Our bootstrap
action had:
command:/usr/local/opnsense/scripts/netboot/bootstrap.sh %s
parameters:%s
so configctl netboot bootstrap netboot_xyz ran:
bootstrap.sh %s 'netboot_xyz'
$1 was the literal string '%s', which doesn't match the case statement
(netboot_xyz | ipxe), so the script fell through to the unknown-preset
arm, echoed an error to stderr, and exited 64. configd's script_output
captures only stdout and returns empty on non-zero exit. Hence the
GUI's "produced no output" path firing every time.
How we caught it: the new diag endpoint showed direct-exec of
bootstrap.sh from PHP produced 375 bytes of correct stdout AND
downloaded both binaries, while the configd probe of the same script
returned 0 bytes in 84ms. The 84ms was the giveaway -- a 1.5 MB
download can't finish that fast; the script was completing instantly
because it was bailing out on argv mismatch.
Fix: drop %s from the command: line in both [bootstrap] and [fetch_url].
Add a sharp comment at the top of the actions block explaining the
rule so it doesn't recur.
The [bootstrap_netboot_xyz] alias was already correct (no %s anywhere)
and worked fine via direct exec, but went through the same broken
flow because it called the same script through configd. With this fix
it works too.1 parent b324b4d commit 54e93d2
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
85 | 95 | | |
86 | | - | |
| 96 | + | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
| |||
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
97 | | - | |
| 107 | + | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
| |||
0 commit comments