Heres a runcmd section from one of my user-data files I use with Atomic: runcmd: # Workaround until power_state is included in cloud.cfg 5 min delay is a guess - [ /usr/sbin/shutdown, -r, "+5", "Restarting" ] - [ /bin/systemctl, daemon-reload ] - [ /bin/systemctl, enable, cockpitws.service ] - [ /bin/systemctl, daemon-reexec ]
This format has been the best for parsing cleanly, with each arg quoted. HTH, - Matt M On Thu, Apr 14, 2016 at 7:24 PM, solarflow99 <solarflo...@gmail.com> wrote: > hi, thanks. but This is a nice working example of redhat's FAQ also has. > What i'm looking to do is extend user-data to run some commands, or even > better to call a shell script. I don't know if runcmd can do that. I'll > keep googling for examples I guess, just thought i'd check here first. > > , > > On Thu, Apr 14, 2016 at 4:13 PM, Karanbir Singh <mail-li...@karan.org> > wrote: > >> On 15/04/16 00:03, solarflow99 wrote: >> > Not sure if this is a better question for cloud-init ML or not, i'm >> > trying to find working examples of running commands in the user-data >> > file. I noticed some commands don't work, it looks like it's because >> > its being parsed as yaml and some characters cause problems with that. >> > It would be nice if I could just call an external shell script, but so >> > far I can't seem to do it. Does anyone have any better info on this? >> > >> > >> >> does this help : >> https://github.com/kbsingh/atomic-ci/tree/master/tests/z_0-genConfigDrive >> >> >> -- >> Karanbir Singh >> +44-207-0999389 | http://www.karan.org/ | twitter.com/kbsingh >> GnuPG Key : http://www.karan.org/publickey.asc >> >> >