Startup scripts
From Luna Node
Revision as of 06:39, 13 December 2014 by Favyen Bastani (Talk | contribs)
Startup scripts can be defined from the Startup Scripts sidebar item. These scripts can then be selecting when provisioning new virtual machines, and selected scripts will execute when the new instance boots for the first time.
Shell scripts
Shell scripts (such as scripts for bash) start with "#!" on the first line, generally followed by a path to the shell binary. For example, this bash script will update packages on Debian-based operating systems:
#!/bin/bash apt-get update; apt-get upgrade -y
cloud-config scripts
cloud-config scripts can be used on images that have cloud-init installed (this includes the default template images). These can more reliably configure operating system parameters than shell scripts, and are generally easier to write.