OpenMosix Config Files

From Clustergroup
Revision as of 16:29, 1 April 2005 by DP110 (talk | contribs) (Category again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

/etc/openmosix/openmosix.conf

# The only setting needed in this file is: 
# Force autodiscovery-daemon to start, even with a valid .map-file
AUTODISC=1
# Optionally set the node speed for load balancing
# Pass the following value to mosctl setspeed when starting the node
# man mosctl for details
NODESPEED=10000

Other Files

/etc/inittab

id:3:initdefault:
# System initialization, mount local filesystems, etc.
si::sysinit:/bin/mosrun -h /sbin/rc sysinit
# Further system initialization, brings up the boot runlevel.
rc::bootwait:/bin/mosrun -h /sbin/rc boot
l0:0:wait:/bin/mosrun -h /sbin/rc shutdown 
l1:S1:wait:/bin/mosrun -h /sbin/rc single
l2:2:wait:/bin/mosrun -h /sbin/rc nonetwork
l3:3:wait:/bin/mosrun -h /sbin/rc default
l4:4:wait:/bin/mosrun -h /sbin/rc default
l5:5:wait:/bin/mosrun -h /sbin/rc default
l6:6:wait:/bin/mosrun -h /sbin/rc reboot
#z6:6:respawn:/bin/mosrun -h /sbin/sulogin
# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
c2:12345:respawn:/sbin/agetty 38400 tty2 linux
c3:12345:respawn:/sbin/agetty 38400 tty3 linux
c4:12345:respawn:/sbin/agetty 38400 tty4 linux
c5:12345:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux
# What to do at the "Three Finger Salute".
ca:12345:ctrlaltdel:/bin/mosrun -h /sbin/shutdown -r now
# Used by /etc/init.d/xdm to control DM startup.
# Read the comments in /etc/init.d/xdm for more
# info. Do NOT remove, as this will start nothing
# extra at boot if /etc/init.d/xdm is not added
# to the "default" runlevel.
x:a:once:/etc/X11/startDM.sh
# End of /etc/inittab

/etc/profile

# /etc/profile:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/profile,v 1.23 2003/04/29 21:23:18 azarah Exp $
## Tell shells to allow subprocs to migrate to other nodes
echo 0 > /proc/self/lock # Added for openMosix
if [ -e "/etc/profile.env" ]
then
	. /etc/profile.env
fi
# 077 would be more secure, but 022 is generally quite realistic
umask 022
if [ `/usr/bin/whoami` = 'root' ]
then
	# Do not set PS1 for dumb terminals
	if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ]
	then
		export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
	fi
	export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"
else
	# Do not set PS1 for dumb terminals
	if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ]
	then
		export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
	fi
	export PATH="/bin:/usr/bin:${PATH}"
fi
## Add ccache and distcc to PATH
export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"
unset ROOTPATH
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]
then
	export INPUTRC="/etc/inputrc"
fi
# Extract the value of EDITOR
[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
[ -z "$EDITOR" ] && EDITOR="`. /etc/conf.d/basic 2>/dev/null; echo $EDITOR`"
[ -z "$EDITOR" ] && EDITOR="/bin/nano"
export EDITOR

/etc/init.d/openmosix

#!/sbin/runscript
#
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
 depend() {
	need net
}
stop() {
	ebegin "Stopping openMosix"
        # Expel all processes and disable openMosix configuration
       einfo "openMosix: "
       mosctl expel
	setpe -off
       killall -TERM omdiscd &> /dev/null
	rm -f /var/lock/subsys/mosix
	eend
}
start() {
# If we're not running an openMosix enabeled kernel: exit
if [ ! -d /proc/hpc ]; then
    einfo "This is not an openMosix kernel, configuration aborted"
    exit
fi
# Find the openMosix map-file
AUTODISC=0
if [ -f /etc/openmosix.map ]; then
    OMOSIX_MAP=/etc/openmosix.map
elif [ -f /etc/mosix.map ]; then
    OMOSIX_MAP=/etc/mosix.map
    einfo "openMosix map-file /etc/mosix.map depreciated: Rename to /etc/openmosix.map"
elif [ -f /etc/hpc.map ]; then
    OMOSIX_MAP=/etc/hpc.map
    einfo "openMosix map-file /etc/hpc.map depreciated: Rename to /etc/openmosix.map"
else
    AUTODISC=1
fi
OMnode=""
if [ -f /etc/openmosix/om-node-num ]
then
  OMnode="-p $(< /etc/openmosix/om-node-num)"
fi
# Check the map-file for sanity
if [ $AUTODISC -eq 0 ]; then
    setpe $OMnode -c -f $OMOSIX_MAP &> /dev/null
    if [ ! $? -eq 0 ]; then
        einfo "openMosix: Invalid configuration in map-file $OMOSIX_MAP, using autodiscovery"
        AUTODISC=1
    fi
fi
# Source the configuration from /etc/openmosix/openmosix.config
# This file would be a good place to force autodiscovery by setting AUTODISC=1
[ -f /etc/openmosix/openmosix.config ] && . /etc/openmosix/openmosix.config
# Make sure we have omdiscd installed
if [ $AUTODISC -eq 1  ]; then
    if [ ! -x `which omdiscd` ]; then
        eerror "openMosix: omdiscd not installed, exiting"
        eend
    fi
fi
 	ebegin "Initializing openMosix"
       # The variables $OVERHEADS, $MFSCOSTS, $MYOMID, $MOSGATES and $AUTODISCIF
       # can be set to desired values in /etc/openmosix/openmosix.config
       [ $OVERHEADS ] && echo $OVERHEADS > /proc/hpc/admin/overheads
       [ $MFSCOSTS  ] && echo $MFSCOSTS  > /proc/hpc/admin/mfscosts 
       if [ $AUTODISC -eq 0  ]; then
           # Static configuration via $OMOSIX_MAP
           SETPE_OPTIONS=""
	    [ $MYOMID ] && SETPE_OPTIONS="$SETPE_OPTIONS -p $MYOMID"
	    [ $MOSGATES ] && SETPE_OPTIONS="$SETPE_OPTIONS -g $MOSGATES"
	    setpe $OMnode -W $SETPE_OPTIONS -f $OMOSIX_MAP
      else
           # Configurate openMosix with the omdiscd
	    OMDISCD_OPTIONS=""
	    [ $AUTODISCIF ] && OMDISCD_OPTIONS="$OMDISCD_OPTIONS -i $AUTODISCIF"
	    omdiscd $OMDISCD_OPTIONS
      fi
      [ $? -eq 0 ] && touch /var/lock/subsys/openmosix
      mosctl noblock 1>/dev/null 2>&1
      eend
}

See Also : Gentoo Linux and OpenMosix