-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runcmd doesn't seem to work properly #24
Comments
This is a YAML language / YAML parser issue, in essence. The yaml-to-glib parser we have has issues with arrays in this way. As you can see from the examples, wrapping the commands in https://github.com/clearlinux/micro-config-drive/blob/master/examples/runcmd.yaml IOW, do this instead:
As a side note, when it comes to services, you can always do this: https://github.com/clearlinux/micro-config-drive/blob/master/examples/service.yaml |
Closing this as I think we'll keep the current behavior. Redoing the parser may be too much work. |
Thanks for the tip. I'll update my cloud-init files to use the service tag. I'm still a little worried about the bug though. From what I can tell you should be able to specify a string and not just an array of strings for each cmd. From http://cloudinit.readthedocs.io/en/latest/topics/modules.html#runcmd
Even in the example, not all the commands are wrapped in [], https://github.com/clearlinux/micro-config-drive/blob/master/examples/runcmd.yaml#L6 Is udc processing this example correctly? I've also found some other examples on the web where people aren't using arrays of arrays of string for runcmd, e.g., http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html This issue might cause problems for people migrating their cloud-init files to work with udc. Is this behaviour documented somewhere? |
It processes the example correctly by sheer coincidence, since there is only one example without |
I guess I must be doing something wrong, but I'm experiencing a weird problem on clearlinux 19110. I have a cloud init file with a runcmd section that looks like this.
ucd is not running these commands correctly. It does
/bin/sh -c "systemctl start sshd systemctl enable sshd"
which fails. I'd expect it to do
/bin/sh -c "systemctl start sshd"
/bin/sh -c "systemctl enable sshd"
I don't really understand how the g_node stuff works but looking at the code
https://github.com/clearlinux/micro-config-drive/blob/master/src/ccmodules/runcmd.c#L52
It does seem like ucd concatenates all the commands in the runcmd section into one large string which it executes in one go, which is unlikely to work.
The text was updated successfully, but these errors were encountered: