rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.44k stars 655 forks source link

bootcmd -- not working for me #1968

Open PaulCharlton opened 7 years ago

PaulCharlton commented 7 years ago

RancherOS Version: (ros os version)

ros version v1.0.3

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)

virtualbox on MacOS

=========================

output

dmesg |grep techg
[   26.949770] techguru runcmd
[   26.958183] techguru start.sh
[   26.961883] techguru rc.local
[   30.100774] techguru rc.local.docker_loaded

cloud_config.yml

bootcmd:
  - echo techguru bootcmd | sudo /bin/tee /dev/kmsg
write_files:
  - path: /opt/rancher/bin/start.sh
    owner: root
    permissions: "0755"
    content: |
      #!/bin/bash --
      echo techguru start.sh | sudo /bin/tee /dev/kmsg
  - path: /etc/rc.local
    owner: root
    permissions: "0755"
    content: |
      #!/bin/bash --
      echo techguru rc.local | sudo /bin/tee /dev/kmsg
      wait-for-docker
      echo techguru rc.local.docker_loaded | sudo /bin/tee /dev/kmsg
runcmd:
  - echo techguru runcmd | sudo /bin/tee /dev/kmsg

also tried bootcmd with touch /mnt/foo

PaulCharlton commented 7 years ago

I see why bootcmd is not running for me. bootstrap is occurring before cloudinit and before switchroot, which means that the only cloud init available to bootstrap is the one provided to the docker-machine driver (which in my case is virtualbox, which does not provide one) re: init/init.go. The configs on the RANCHER_STATE persistent drive are not yet mounted or scanned.

This is not resolved (yet)

SvenDowideit commented 7 years ago

yeah, I'm thinking about removing bootcmd - I'm struggling to find a place that it can actually work, or a functionality that could be used.