/[gentoo-x86]/sys-kernel/linux-extras/files/2.4.6-r2/mosix.init
Gentoo

Contents of /sys-kernel/linux-extras/files/2.4.6-r2/mosix.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Fri Oct 12 03:59:48 2001 UTC (18 years, 9 months ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
massive cleanup

1 pete 1.1 #!/bin/sh -
2     #RCUPDATE:2 3 4:95:This line is required for script management
3    
4     # description: MOSIX is am extension of the operating system,
5     # supporting scalable and transparent cluster computing.
6     #
7     # mosix Script to stop/start MOSIX
8     #
9     # Author: Amnon Shiloh
10    
11     . /etc/rc.d/config/functions
12    
13     SERVICE="mosix"
14     opts="start stop status restart"
15    
16     mosix_stop() {
17     echo 0 > /proc/mosix/admin/mospe
18     rm -f /var/lock/subsys/mosix
19     }
20    
21     mosix_start() {
22     if [ -s /etc/overheads -a -f /proc/mosix/admin/overheads ]
23     then
24     /bin/grep -v '^#' /etc/overheads > /proc/mosix/admin/overheads
25     fi
26     if [ -s /etc/mfscosts -a -f /proc/mosix/admin/mfscosts ]
27     then
28     /bin/grep -v '^#' /etc/mfscosts > /proc/mosix/admin/mfscosts
29     fi
30     a1=
31     [ -s /etc/mospe ] && a1="-p `cat /etc/mospe`"
32     a2=
33     [ -s /etc/mosgates ] && a2="-g `cat /etc/mosgates`"
34     /sbin/setpe -W $a1 $a2 -f /etc/mosix.map
35     touch /var/lock/subsys/mosix
36     }
37    
38     alarm() {
39     t=$2
40     while :
41     do
42     case "$t" in 0) break ;; esac
43     sleep 1
44     t=$(($t-1))
45     done
46     kill -1 $1
47     exit 0
48     }
49    
50     # See how we were called.
51     start() {
52     eecho "Initializing MOSIX"
53     if [ ! -f /etc/mosix.map ]
54     then
55     echo You have no MOSIX configuration - please edit yours now:
56     echo -n "Editor to use [q to quit] - [vi] :- "
57     trap 'echo Timed-Out ; exit 1' 1
58     alarm $$ 120 &
59     killer=$!
60     read editor
61     kill $killer
62     trap ''
63     case "$editor" in [qQ]) exit ;;
64     "") editor=/usr/bin/vi
65     [ -f $editor ] || editor=/bin/vi
66     ;;
67     esac
68     echo "# MOSIX CONFIGURATION" > /etc/mosix.map
69     echo "# ===================" >> /etc/mosix.map
70     echo "#" >> /etc/mosix.map
71     echo "# Each line should contain 3 fields, mapping IP addresses to MOSIX node-numbers:" >> /etc/mosix.map
72     echo "# 1) first MOSIX node-number in range." >> /etc/mosix.map
73     echo "# 2) IP address of the above node (or node-name from /etc/hosts)." >> /etc/mosix.map
74     echo "# 3) number of nodes in this range." >> /etc/mosix.map
75     echo "#" >> /etc/mosix.map
76     echo "# MOSIX-# IP number-of-nodes" >> /etc/mosix.map
77     echo "# ============================" >> /etc/mosix.map
78     $editor /etc/mosix.map
79     echo
80     while :
81     do
82     echo "If this node's standard IP address is not part of the table that"
83     echo "you just edited, because MOSIX uses a different or separate network,"
84     echo "you need to type this node's MOSIX-number now."
85     echo
86     /bin/echo -n "Otherwise please press only <Enter> :- "
87     read me
88     case "$me" in "") /bin/rm -f /etc/mospe ; break ;;
89     [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | \
90     [1-9][0-9][0-9][0-9] | \
91     [1-6][0-9][0-9][0-9][0-9])
92     echo $me > /etc/mospe ; break ;;
93     *) echo Improper MOSIX number - please try again: ;;
94     esac
95     done
96     fi
97     start_mosix
98     eend
99     }
100    
101     stop() {
102     eecho "Stopping MOSIX"
103     stop_mosix
104     eend
105     }
106    
107     status() {
108     /sbin/setpe -r
109     }
110    
111     restart() {
112     eecho "Restarting MOSIX"
113     stop_mosix
114     start_mosix
115     eend
116     }
117    
118     doservice ${@}

  ViewVC Help
Powered by ViewVC 1.1.20