#!/bin/sh # Very simple script to copy the global hosts file over the local one # while preserving the localhost entry. Run on DETER master clients grep 127\\.0\\.0\\.1 /etc/hosts > /tmp/hosts cat $1 >> /tmp/hosts cp /tmp/hosts /etc/hosts && rm /tmp/hosts # Find the right version of pkill. For killing. if [ -x "/usr/bin/pkill" ] ; then PKILL="/usr/bin/pkill" else if [ -x "/bin/pkill" ] ; then PKILL="/bin/pkill" else PKILL="echo" fi fi # SEER feels pain and confusion if times are wrong. This lays a big lick on # ntp sets the time directly and then restarts it. XXX FreeBSD incantation is # untested. case `uname` in "FreeBSD") /etc/rc.d/ntpd stop /usr/sbin/ntpdate boss /etc/rc.d/ntpd start ;; "Linux") /etc/rc.d/init.d/ntpd stop /usr/sbin/ntpdate boss /etc/rc.d/init.d/ntpd start ;; esac # I remain unclear why ospfd seems screwed up after the resetting of accounts # and mounts. This seems to fix it, but it's not very satisfying. At this # point the federated topology is complete, so any problems with routing in a # partial topology -e.g. failed or partial bridging - that might have confused # the router should be gone. $PKILL ospf $PKILL gated # XXX Danger, hack ahead. Apparently our FC6-SMB image and emulab disagree # about where gated lives. This will alias it. if [ ! -x /usr/sbin/gated ] ; then if [ -x /sbin/gated ] ; then ln /sbin/gated /usr/sbin/gated fi fi /usr/local/etc/emulab/rc/rc.route # Execute any command passed in as a startcmd. This basically daisy chains the # startcmd. This needs to become a perl script to have uniform behavior here. echo "*$2* *$3*" if [ ! -z "$2" ]; then echo "calling *$2* *$3*" case `uname` in "FreeBSD") su -l "$2" -c "$3" ;; "Linux") su "$2" --command="$3" ;; esac fi