~hudson-openstack/nova/cactus

« back to all changes in this revision

Viewing changes to doc/source/devref/rc.local

  • Committer: Tarmac
  • Author(s): Vishvananda Ishaya
  • Date: 2011-04-13 08:32:06 UTC
  • mfrom: (976.2.2 better-docs)
  • Revision ID: tarmac-20110413083206-o9sptovi465hrv6l
Updates the documentation on creating and using a cloudpipe image.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
#
 
3
# rc.local
 
4
#
 
5
# This script is executed at the end of each multiuser runlevel.
 
6
# Make sure that the script will "exit 0" on success or any other
 
7
# value on error.
 
8
#
 
9
# In order to enable or disable this script just change the execution
 
10
# bits.
 
11
#
 
12
# By default this script does nothing.
 
13
####### These lines go at the end of /etc/rc.local #######
 
14
. /lib/lsb/init-functions
 
15
 
 
16
echo Downloading payload from userdata
 
17
wget http://169.254.169.254/latest/user-data -O /tmp/payload.b64
 
18
echo Decrypting base64 payload
 
19
openssl enc -d -base64 -in /tmp/payload.b64 -out /tmp/payload.zip
 
20
 
 
21
mkdir -p /tmp/payload
 
22
echo Unzipping payload file
 
23
unzip -o /tmp/payload.zip -d /tmp/payload/
 
24
 
 
25
# if the autorun.sh script exists, run it
 
26
if [ -e /tmp/payload/autorun.sh ]; then
 
27
  echo Running autorun.sh
 
28
  cd /tmp/payload
 
29
  sh /tmp/payload/autorun.sh
 
30
 
 
31
else
 
32
  echo rc.local : No autorun script to run
 
33
fi
 
34
 
 
35
 
 
36
exit 0