← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1670071] Re: runcmd does not actually run commands

 

[Expired for cloud-init because there has been no activity for 60 days.]

** Changed in: cloud-init
       Status: Incomplete => Expired

-- 
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:
  Expired

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


References