source: fedkit/make_hosts @ 7add1a3

axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change on this file since 7add1a3 was 7add1a3, checked in by Ted Faber <faber@…>, 16 years ago

stop the routing daemon before we restart it

  • Property mode set to 100755
File size: 1.8 KB
RevLine 
[3c7da22]1#!/bin/sh
2
3# Very simple script to copy the global hosts file over the local one
4# while preserving the localhost entry.  Run on DETER master clients
5
6grep 127\\.0\\.0\\.1 /etc/hosts > /tmp/hosts
7cat $1 >> /tmp/hosts
8cp /tmp/hosts /etc/hosts && rm /tmp/hosts
[e06b224]9
[7add1a3]10# Find the right version of pkill.  For killing.
11if [ -x "/usr/bin/pkill" ] ; then 
12        PKILL="/usr/bin/pkill"
13else
14        if [ -x "/bin/pkill" ] ; then 
15                PKILL="/bin/pkill"
16        else
17                PKILL="echo"
[f778038]18        fi
19fi
20
[7c3008e]21# SEER feels pain and confusion if times are wrong.  This lays a big lick on
22# ntp sets the time directly and then restarts it.  XXX FreeBSD incantation is
23# untested.
24
25case `uname` in
26        "FreeBSD")
27                /etc/rc.d/ntpd stop
28                /usr/sbin/ntpdate boss
29                /etc/rc.d/ntpd start
30                ;;
31        "Linux")
32                /etc/rc.d/init.d/ntpd stop
33                /usr/sbin/ntpdate boss
34                /etc/rc.d/init.d/ntpd start
35                ;;
36esac
[7add1a3]37# I remain unclear why ospfd seems screwed up after the resetting of accounts
38# and mounts.  This seems to fix it, but it's not very satisfying.  At this
39# point the federated topology is complete, so any problems with routing in a
40# partial topology -e.g. failed or partial bridging - that might have confused
41# the router should be gone.
42$PKILL ospf
43$PKILL gated
44
45# XXX Danger, hack ahead.  Apparently our FC6-SMB image and emulab disagree
46# about where gated lives.  This will alias it.
47if [ ! -x /usr/sbin/gated ] ; then 
48        if [ -x /sbin/gated ] ; then
49                ln /sbin/gated /usr/sbin/gated
50        fi
51fi
52/usr/local/etc/emulab/rc/rc.route
53
[7c3008e]54
55# Execute any command passed in as a startcmd.  This basically daisy chains the
56# startcmd.  This needs to become a perl script to have uniform behavior here.
57echo "*$2* *$3*"
[e06b224]58if [ ! -z "$2" ]; then 
[7c3008e]59        echo "calling *$2* *$3*"
60        case `uname` in
61                "FreeBSD")
62                        su -l "$2" -c "$3"
63                        ;;
64                "Linux")
65                        su "$2" --command="$3"
66                        ;;
67        esac
[e06b224]68fi
Note: See TracBrowser for help on using the repository browser.