Changes between Version 7 and Version 8 of HowTo/WriteInstallScript


Ignore:
Timestamp:
09/25/12 13:11:55 (12 years ago)
Author:
nriga@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowTo/WriteInstallScript

    v7 v8  
    33
    44In GENI [wiki:GENIExperimenter/RSpecs RSpecs], you have the capability of instructing an Aggregate Manager to download software from the web, and execute install scripts at boot up time.
    5 This page provides step by step instructions about how to write and use install scripts. In summary the steps you have to take are:
    6 [[PageOutline(1-100,,inline, Unnumbered)]]
     5This page provides step by step instructions about how to write and use install scripts.
     6
     7= 1. Write your script =
     8The first step is to write your install script. While writing your script you should keep in mind that:
     9   * your script '''does not run in the context of your user''', this means that if you decide to place things in your home directory you will have to make sure that you change the permissions so that you will have access to them when you login
     10   * your script '''does run as a user with [http://en.wikipedia.org/wiki/Sudo `sudo` privileges]''', you can do anything that you can do in the context of your user. Make sure you use `sudo` when:
     11      o you execute privileged commands (e.g. `yum`, `apt-get`, `service`)
     12      o you place things in your home directory
     13      o you try to write files in protected directories (e.g. `/usr/locac/bin/, /local/)
     14   * the [http://en.wikipedia.org/wiki/PATH_(variable) `$PATH` environment variable] is not necessarily set, make sure you use the full path of commands in your scripts; for example don't use `ifconfig`, but use `/sbin/ifconfig`. This is also true for the interpreters used for your script.Make sure you add
     15   * your script runs '''every time the host reboots''', so if you reboot the host as part of your script you have to '''check if your script has already ran''' or you will end up in a cycle of reboots.
     16
     17You can use any scripting language you want, popular choices are:
     18  * [http://en.wikipedia.org/wiki/Shell_script shell scripts], there are many tutorials online that can guide you through it.
     19  * [ http://www.perl.org/ Perl]. Make sure that perl is installed by default in the Image you are using. Login to your nodes and type `perl -h`.
     20  * [http://www.python.org/ Python]. Make sure that perl is installed by default in the Image you are using. Login to your nodes and type `python -h`.
     21
     22If an interpreter for the scripting language of your choice is not installed, you can write a short shell script that will first install it 
    723
    824
    9 = 1. Write your script =
    10 The first step is to write your install script.
    1125= 2. Test your script =
    1226= 3. Find a Web Server =