Skip to content

runcmd considers the exit code for the last command only #7037

Description

@bjornt

Bug report

When using runmd, the last command in that list will determine the result of the runcmd
step. If the last command fails, cloud-init will report an error. If the last command
succeeds, all the previous command may fail, and cloud-init still reports success.

This is an inconsistency that I couldn't find in the documentation.

Steps to reproduce the problem

Use the following cloud-init config to see cloud-init report success:

#cloud-config
runcmd:
  - /bin/false
  - /bin/true

Use the following cloud-init config to see cloud-init report failure:

#cloud-config
runcmd:
  - /bin/true
  - /bin/false

Environment details

  • Cloud-init version: 26.1-0ubuntu2
  • Operating System Distribution: Ubuntu 26.04
  • Cloud provider, platform or installer type: lxd

cloud-init logs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlynewAn issue that still needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions