errors while running runcmd lines should fail the first boot

Bug #1802316 reported by Thomas JOUANNOT
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Wishlist
Unassigned

Bug Description

given a list of commands specified in a "runcmd" list, if a command fails i think it should prevent the next commands from running and mark the execution as failed
also, the power_state should be ignored.

Revision history for this message
Scott Moser (smoser) wrote :

> given a list of commands specified in a "runcmd" list, if a command fails
> i think it should prevent the next commands from running and mark the
> execution as failed

I generally agree that that is how it *should* have been done.
At this point though we'd have to extend... so that backwards compatibility
is maintained.

> also, the power_state should be ignored.

For this I'm not so sure. power_state does have a 'condition' which
allows you to implement the logic yourself.

https://cloudinit.readthedocs.io/en/latest/topics/modules.html#power-state-change

Revision history for this message
Thomas JOUANNOT (mazerty) wrote :

that's really a shame :(
isn't there a way to optionally have this behavior ? like with a boolean which would default to false for backward compatibility, but set to true, would behave like described above ?

Revision history for this message
Ryan Harper (raharper) wrote :

Hi,

Thanks for filing the issue. It would be possible to introduce new cloud-config for run_cmd, something like:

#cloud-config
runcmd_chain_commands: true # we can bikeshed this
runcmd:
   - /bin/false
   - echo "Hi, this shouldn't execute"

Alternatively, you can use write_files to render a shell command which runs with set -e; and then runcmd to execute it.

Changed in cloud-init:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.