yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #62030
[Bug 1670071] [NEW] runcmd does not actually run commands
Public bug reported:
Versions: 0.7.5 , 0.7.9
I've added a config to my /etc/cloud/cloud.cfg.d directory that has the
following:
runcmd:
- /bin/foo.sh
It properly generates a file in:
/var/lib/cloud/instances/iid-datasource-none/scripts/runcmd
#!/bin/sh
/bin/foo.sh
But when I run :
cloud-init -d modules --mode config
That script is never executed.
I compared the code for runcmd to bootcmd, and bootcmd has a block a
code that runcmd does not:
try:
env = os.environ.copy()
iid = cloud.get_instance_id()
if iid:
env['INSTANCE_ID'] = str(iid)
cmd = ['/bin/sh', out_fn]
util.subp(cmd, env=env, capture=False)
except:
util.logexc(log, "Failed to run runcmd module %s", name)
raise
If I add this to my runcmd module the it will successfully run the commands.
** Affects: cloud-init
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1670071
Title:
runcmd does not actually run commands
Status in cloud-init:
New
Bug description:
Versions: 0.7.5 , 0.7.9
I've added a config to my /etc/cloud/cloud.cfg.d directory that has
the following:
runcmd:
- /bin/foo.sh
It properly generates a file in:
/var/lib/cloud/instances/iid-datasource-none/scripts/runcmd
#!/bin/sh
/bin/foo.sh
But when I run :
cloud-init -d modules --mode config
That script is never executed.
I compared the code for runcmd to bootcmd, and bootcmd has a block a
code that runcmd does not:
try:
env = os.environ.copy()
iid = cloud.get_instance_id()
if iid:
env['INSTANCE_ID'] = str(iid)
cmd = ['/bin/sh', out_fn]
util.subp(cmd, env=env, capture=False)
except:
util.logexc(log, "Failed to run runcmd module %s", name)
raise
If I add this to my runcmd module the it will successfully run the commands.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1670071/+subscriptions
Follow ups