#!/bin/bash ## Example start_mount_code for the w-iLab.t tutorial ## In the example, I set up a network with one "coordinator" node and several other nodes. The behavior of my nodes ## is determined by my own program, called "custombin", which can take "coordinator" or "regular" as an argument, ## depending on whether the node has a certain "coordinator" role (e.g. a node with a full view on the network) or not. ## ## In the example below, inode003 is configured as a coordinator, inode004 does nothing but reporting that it is inode004, ## all other nodes that are in included in my experiment will behave as "regular" nodes. ## WHAT TO DO AS A COORDINATOR NODE if [ `hostname` == "inode003" ]; then echo "I am the coordinator" >> /tmp/log/mylogfile.txt echo `date` "Starting my custom binary..." >> /tmp/log/mylogfile.txt ## Below, I start my own "custombin" binary (available under my iPlatform subdirectory) with argument coordinator ## custombin needs custom libraries that I included in my own "libs" folder under my iPlatform folder LD_LIBRARY_PATH=~/iPlatform/libs:$LD_LIBRARY_PATH /tmp/mnt/custombin coordinator &> /tmp/log/outputofCustombin.txt & ## WHAT TO DO AS ANOTHER SPECIAL ROLE elif [ `hostname` == "inode004" ]; then echo "I am inode004" >> /tmp/log/mylogfile.txt ## WHAT TO DO AS ANY OTHER NODE else echo "I am an ordinary node." > /tmp/log/log.txt ## I want the ordinary nodes to start a bit later compared to the coordinator node sleep 45 echo `date` "Starting my own program" >> /tmp/log/mylogfile.txt LD_LIBRARY_PATH=~/iPlatform/libs:$LD_LIBRARY_PATH custombin regular &> /tmp/log/mylogfile.txt & fi