Tools and Scripts


There are a few tools and scripts to assist your experiements. Source code is available at scadds cvs repository.

rsh104

To run applications on mutiple nodes. For example: 

rsh104 "18 11" reboot   # reboot node 11 and node 18
rsh104 all fsck               # check filesystem on all nodes

rsh104 "all" requires  environment variable "MYPC104" to be set as the node list in your exeriement. For example, you may put

export MYPC104="11 12 23 34"
in ~/.bashrc 

ping104 

To test if nodes are all up. For example,

[zhaoy@scadds zhaoy]$ ping104 "11 39 26"
Node 11 is alive.
Node 39 died.
Node 26 is alive.
With no arguments, ping104 will test all nodes in MYPC104 environment variable.

update104 

To update the file sytems on specified testbed nodes. For example,

update104 "11 39 26"  # update node 11 39 and 26
update104 all                #update all nodes 

rdate104

To synchronize (software) clocks on specified nodes to scadds.isi.edu. For example

rdate104 "11 39 26"  # synchronize clocks of node 11 39 and 26

lib104

This script tries to update the binary excutables on pc104 testbed to the current files on the host PC. It also decides what dynamically linked libraries are used by those executables. When libraries are copied to pc104 linux distribution, all the symbolic links are preserved.  It first decides the initial library list by checking the executables, then recursively copy depedent libraries "required by" or "linked from".By this way, the linux system on pc104 can always be compatible to the host PC and with minimized size. For example, to add fsck to pc104 

[zhaoy@sunshine zhaoy]$ cd ~/pc104
[zhaoy@sunshine pc104]$ cd /sbin/fsck.ext2 ./sbin
[zhaoy@sunshine pc104]$ lib104
Entering bin
Leaving bin
Entering sbin
Leaving sbin
Stripping executables ...
Erasing all libaries in ./lib .....
Copying libnss_files.so.2 ld-linux.so.2 libcom_err.so.2 libcrypt.so.1 libc.so.6 libdl.so.2 libe2p.so.2 libext2fs.so.2 libm.so.6 libncurses.so.5 libnsl.so.1 libpam_misc.so.0 libpam.so.0 libproc.so.2.0.7 libpthread.so.0 libreadline.so.4 libresolv.so.2 librt.so.1 libstdc++-libc6.2-2.so.3 libtermcap.so.2 libutil.so.1 libuuid.so.1
Copying libc-2.2.4.so libcom_err.so.2.0 libcrypt-2.2.4.so libc.so.6 libdl-2.2.4.so libe2p.so.2.3 libext2fs.so.2.4 libm-2.2.4.so libncurses.so.5.2 libnsl-2.2.4.so libnss_files-2.2.4.so libpam_misc.so.0.75 libpam.so.0.75 libpthread-0.9.so libreadline.so.4.2 libresolv-2.2.4.so librt-2.2.4.so libstdc++-3-libc6.2-2-2.10.0.so libtermcap.so.2.0.8 libutil-2.2.4.so libuuid.so.1.2
Stripping Libraries ...
Size of this distribution is around 9.4M .
[zhaoy@sunshine pc104]

Note that it only resolves dependence between binary executables and libraries, so the user have to manually copy configuration files or other files in directories other than sbin,bin,lib.

rsyncpc104config.pl

This script assigns pc104 nodes to different users. Similar to a very simple version of cvs, each user can check out his/her own copy of linux distribution, modify the files and check in to the distribution repository. When a pc104 node boots up, it will check if there are any changes in the assigned user's ditribution at repository. By default, the configuration file /etc/rsyncpc104.conf is in
the format of

#comments
user1 10 12 33-35
user2 11 23

The script checks if there is any conflicts in the assignment and also prints a list of free nodes.

rsync-pc104

The user of pc104 testbed can use this script to check out/in the filesystem on pc104s: "rsync-pc104 co" will check out a copy of distribution to current  directory. "rsync-pc104 ci" will check in the modified files to the repository.

tcp-probe

This program will test if any tcp service is avalilable. It is very helpful to test the water before jumping to request the service. For example,
we need to use "wget ftp://10.0.0.1/file" in a script. However the route to 10.0.0.1 might be unavailable. Thus the script will block there forever.
tcp-probe tries to connect to a service for at most 2 seconds, the exit code will be 0 if it succeeds or 1 if not either due to timeout or rejection
by the remote host. for example:

tcpprobe 10.0.0.1 21 && wget ftp://10.0.0.1/file



Created by Jerry Zhao : 1/2/2002