3

I'm running an Ubuntu 12.04 machine in a very EC2-like environment (Open Stack euca2ools environment).

Basically I launch my instances and give it a GZIPed multipart file as documented here is possible. Here's code for how I convert to multipart file:

write-mime-multipart -z -o multipart.txt.gz \
$PART_HANDLER:text/part-handler \
$IPTXT/serverIP.txt:text/plain \
$CREDS/$CERT.pem:text/plain \
$SCRIPT_DIR/client_script.sh:text/x-shellscript

The problem is that the shell script never executes. I need the other files included before in the mime file before the shell script will work. According to this CloudInit posting, what I'm doing is sound (order-wise).

Anyone know how to get this shell script executing?


EDIT:

I have found this error in my /var/log/cloud-init.log:

Sep 25 22:30:31 server-49412b24-276f [CLOUDINIT] cc_scripts_user.py[WARNING]: failed to run-parts in /var/lib/cloud/instance/scripts
Sep 25 22:30:31 server-49412b24-276f [CLOUDINIT] __init__.py[WARNING]: Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 117, in run_cc_modules#012    cc.handle(name, run_args, freq=freq)#012  File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 78, in handle#012    [name, self.cfg, self.cloud, cloudinit.log, args])#012  File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 326, in sem_and_run#012    func(*args)#012  File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/cc_scripts_user.py", line 31, in handle#012    util.runparts(runparts_path)#012  File "/usr/lib/python2.7/dist-packages/cloudinit/util.py", line 223, in runparts#012    raise RuntimeError('runparts: %i failures' % failed)#012RuntimeError: runparts: 1 failures

which seems to indicate (of course) that a part of the multipart file was not executed...which isn't exactly helpful in debugging. The script client_script.sh in question runs fine in a terminal.

4

0 回答 0