text/x-shellscript doesn't run if text/cloud-boothook present
Bug #1086646 reported by
DaveQB
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
From my testing, it seems if you have a multipart user-data file that contains both a boothook and a shell script, the latter will not run. I have been testing with all sorts of user-data files and only in this setup (a boothook AND a script) do I see the shell script not run at all.
This is using the the Amazon Ubuntu 12.04.1 AMI (ami-ac4300fe)
PS
The reason I am at this point is that running "echo myhostname > /etc/hostname" in the boothook sees it overwritten by cloud-init. Even with a line like this in the boothook "sed -i 's/preserve_
Thanks.
To post a comment you must log in.
Hi, /help.ubuntu. com/community/ CloudInit . I've attached the user-data that was created by write-mime- multipart, but here is what I did to try to reproduce:
Thanks for taking the time to open a bug and help in making Ubuntu better.
I'm not able to recreate the issue you're seeing. Working off the doc at https:/
# ami-9c78c0f5 = us-east-1 ubuntu- precise- 12.04-amd64- server- 20121026. 1
$ cat my-boothook
#!/bin/sh
echo "=== $(date): running $0 $* ===" | tee -a /root/boothook.log
echo myhostname > /etc/hostname
$ cat my-userscript t.log
#!/bin/sh
echo "=== $(date): running $0 $* ===" | tee -a /root/userscrip
$ write-mime- multipart --output= userdata. txt \ text/cloud- boothook my-userscript: text/x- shellscript
my-boothook:
$ euca-run-instances --key=brickies --instance- type=t1. micro \ data-file= userdata. txt ami-9c78c0f5
--user-
Then, inside the instance I did: cloud/instances /i-06d52c78/ boothooks/ my-boothook === userscript. log cloud/instance/ scripts/ my-userscript ===
$ sudo sh -c 'for f in /root/*.log; do echo "#$f"; cat $f; done'
#/root/boothook.log
=== Wed Dec 5 19:09:36 UTC 2012: running /var/lib/
#/root/
=== Wed Dec 5 19:09:49 UTC 2012: running /var/lib/
That shows that the scripts ran 13 seconds apart (one early in boot and one later). And by their names, its clear that one ran as a boothook and one as a user-script.