k3os config.yaml skips subsequent run_cmd steps after command failure

Created on 11 Dec 2020  路  2Comments  路  Source: rancher/k3os

Version (k3OS / kernel)

k3os version 0.11.1

Architecture

x86_64

Describe the bug

If multiple commands are given to run_cmd: in k3os' config.yaml, processing stops after/if a command fails.

To Reproduce

...
run_cmd:

  • "/usr/bin/echo this gets printed"
  • "/usr/bin/sleep 5"
  • "/bin/false"
  • "/usr/bin/echo this does not"
  • "/usr/bin/sleep 15"

Expected behavior

Both echo commands should print to screen.

Actual behavior

Only the first gets printed; the commands after /bin/false are skipped.

Additional context

kinbug

Most helpful comment

That's a great workaround, and one I've used before in other places.

But - if it's expected to be used, can I suggest the docs say as much, and more importantly the boot sequence should indicate that commands are being skipped.

All 2 comments

The simple work-around to to ensure your commands always return 0, e.g.:

run_cmd:
- /bin/false || /bin/true

That's a great workaround, and one I've used before in other places.

But - if it's expected to be used, can I suggest the docs say as much, and more importantly the boot sequence should indicate that commands are being skipped.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mortenlj picture mortenlj  路  6Comments

runningman84 picture runningman84  路  3Comments

pagong picture pagong  路  8Comments

tschuchortdev picture tschuchortdev  路  4Comments

stenwt picture stenwt  路  3Comments