autoinstall is not executing postruncmd commands in user-data section

Bug #1982773 reported by Jeff Hillman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
New
Undecided
Unassigned

Bug Description

Subiquity in Jammy 22.04.1 daily builds

autoinstall is not executing nor logging anything in a postruncmd section of user-data.

It does, however, respect both packages and write_files.

Nothing is logged in /var/log/cloud-init-output.log nor /var/log/cloud-init.log about operations in these sections.

Expected behavior would be for postruncmd to execute after write_files and package, however nothing is happening.

runcmd however, is executing.

Tags: cpe-onsite
Revision history for this message
Jeff Hillman (jhillman) wrote :

attaching server debug log and here's the current entirety of user-data:

```
  user-data:
    write_files:
      - content: |
          PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
          LC_ALL="en_US.UTF-8"
          LANG="en_US.UTF-8"
          LANGUAGE="en_US:en"
          EDITOR="vim"
        owner: "root:root"
        path: /etc/environment
        permissions: "0644"
      - content: |
          config:
            core.https_address: '[::]:8443'
            core.trust_password: P@ssw0rd!
          networks: []
          storage_pools:
          - config:
              source: local
              volatile.initial_source: /dev/vdb
              zfs.pool_name: local
            description: "Local ZFS pool on /dev/sdb"
            name: local
            driver: zfs
          profiles:
          - config: {}
            description: Default LXD profile
            devices:
              eth0:
                name: eth0
                nictype: bridged
                parent: br0
                type: nic
              root:
                path: /
                pool: local
                type: disk
            name: default
          projects:
          - config:
              features.images: "true"
              features.networks: "true"
              features.profiles: "true"
              features.storage.volumes: "true"
            description: Default LXD project
            name: default
        owner: "root:root"
        path: /root/lxd-config
        permissions: "0640"
    packages:
      - net-tools
      - bridge-utils
# - zfsutils-linux
    postruncmd:
      - echo hello > /root/test1
      - zpool destroy local
      - sleep 10
      - apt install zfsutils-linux -y
      - zpool create -f -m none -O compression=on local /dev/vdb
      - cat /root/lxd-config | lxd init --preseed

```

Revision history for this message
Trent Lloyd (lathiat) wrote :

Found this bug while looking at postruncmd today.

It seems that preruncmd/postruncmd is a juju special config key, it's not clear from the commit history, but I believe it exists because juju itself uses bootcmd/runcmd so wants you to use those special keys which it then executes.

So these keys won't work in subiquity or any non-juju environment. 'postruncmd' doesn't exist in the cloud-init repository, only juju's

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.