From: Michael Koehne <kraehe@copyleft.de>
To: Dan Shearer <dan@shearer.org>,
user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Which UPS simulator?
Date: Thu, 12 Feb 2004 16:00:23 +0100 [thread overview]
Message-ID: <20040212150023.GA32317@bakunin.copyleft.de> (raw)
In-Reply-To: <20040212052823.GA4203@erizo.shearer.org>
Moin Dan Shearer,
why UPS simulation ? I'm using normal mconsole cad feature to power
down my UMLs. I only have to ensure that the inittab will trigger a
halt with "ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now" instead
of rebooting. I then have some helpfull scripts.
/opt/uml/bin/uml is using screen :
#------------------------------------------------------------------------------
#!/bin/sh
[ $# = 1 ] || {
echo usage: uml machine
exit 0
}
[ -f /opt/uml/$1/$1.config ] || {
echo machine $1 not defined
}
if [ -f /opt/uml/$1/$1.running ]
then
screen -d -r $1
else
screen -S $1 /opt/uml/bin/uml-start $1
fi
exit 0
#------------------------------------------------------------------------------
/opt/uml/bin/uml-start does a filesystemcheck :
#------------------------------------------------------------------------------
#!/bin/sh
cd /opt/uml/
[ `whoami` != "root" ] && {
echo "only root can use $0"
exit 1
}
[ $# != 1 ] && {
echo "usage: $0 name"
exit 0
}
[ ! -f $1/$1.root.img ] && {
echo "$1/$1.root.img not found"
exit 0
}
[ ! -f $1/$1.swap.img ] && {
echo "$1/$1.swap.img not found"
exit 0
}
[ ! -f $1/$1.options ] && {
echo "$1/$1.options not found"
exit 0
}
[ ! -f /opt/uml/$1/$1.linux ] && {
echo "/opt/uml/$1/$1.linux not found"
exit 0
}
[ -f $1/$1.running ] && {
echo "$1 already running"
exit 0
}
touch $1/$1.running
[ -d $1/$1.root.fs/lost+found ] && umount $1/$1.root.fs
[ -d $1/$1.work.fs/lost+found ] && umount $1/$1.work.fs
echo checking file systems :
[ -f $1/$1.root.img ] && e2fsck -y -f -v $1/$1.root.img
[ -f $1/$1.work.img ] && e2fsck -y -f -v $1/$1.work.img
echo done.
/opt/uml/$1/$1.linux `cat $1/$1.options`
# [ -d $1/$1.root.fs ] && mount -o loop $1/$1.root.img $1/$1.root.fs
# [ -d $1/$1.work.fs ] && mount -o loop $1/$1.work.img $1/$1.work.fs
rm -f $1/$1.running
exit 0
#------------------------------------------------------------------------------
/opt/uml/bin/uml-stop will halt systems
#------------------------------------------------------------------------------
#!/bin/sh
cd /opt/uml
echo -n UML shutdown systems :
for s
do
x=$s/$s.running
if [ ! -f "$x" ]
then
echo " no systems up."
exit 0
else
echo -n " $s "
echo cad | uml_mconsole $s 2>/dev/null >/dev/null
echo -n ".";sleep 1
echo -n ".";sleep 1
echo -n ".";sleep 1
fi
done
echo done.
echo -n UML waiting for systems :
while true
do
for s
do
x=$s/$s.running
if [ ! -f "$x" ]
then
echo all systems down.
exit 0
else
echo -n " $s "
fi
done
echo -n ".";sleep 1
echo -n ".";sleep 1
echo -n ".";sleep 1
done
#------------------------------------------------------------------------------
ask me for a complete shar.gz or tar.gz of my current UML environment :
uml uml-copydef uml-gen uml-start uml-tunctl
uml-bkup uml-createfs uml-mount uml-startall uml-umount
uml-bkupall uml-forward uml-net uml-stop uml_switch
uml-config uml-forward-old uml-running uml-stopall
uml-copyall uml-fsck uml-screen uml-tap1
each UML is defined by a small text config file, so a lot of UMLs
can be managed in a simple way. Backups for virtual UML machines
and migration to other hosts is semiautomatic. e.g. noam is the
site hosting www.copyleft.de and other domains :
#------------------------------------------------------------------------------
HOST="noam"
DOMAIN="copyleft.de"
MODULES=""
#ETH0OPT="tuntap,,,193.101.47.67"
ETH0BASE="193.101.47"
ETH0WORK="193.101.47.64"
ETH0GATE="193.101.47.65"
ETH0ADDR="193.101.47.67"
ETH0CAST="193.101.47.95"
ETH0MASK="255.255.255.224"
NAMESERVER="193.101.47.33"
PROXY="193.101.47.33:3128"
ROOT="/dev/ubd0"
SWAP="/dev/ubd1"
WORK="/dev/ubd2"
STORSIZE=64
SWAPSIZE=128
ROOTSIZE=256
WORKSIZE=2048
#------------------------------------------------------------------------------
I recently reinstalled my Libretto laptop :
Linux makhno 2.6.1-l5skas1 #1 Wed Feb 4 02:25:54 UTC 2004 i686 GNU/Linux
All i had to do to to run noam on this machine was :
ssh makhno mkdir -p /opt/uml/bin
scp /opt/uml/bin/* makhno:/opt/uml/bin
uml-copydef skel makhno
uml-copydef noam makhno
uml-bkup noam makhno
ssh makhno
export PATH=/opt/uml/bin:$PATH
uml-net
uml noam
Bye Michael
--
mailto:kraehe@copyleft.de UNA:+.? 'CED+2+:::Linux:2.4.22'UNZ+1'
http://www.xml-edifact.org/ CETERUM CENSEO WINDOWS ESSE DELENDAM
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2004-02-12 15:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-12 5:28 [uml-devel] Which UPS simulator? Dan Shearer
2004-02-12 15:00 ` Michael Koehne [this message]
2004-02-12 23:08 ` Dan Shearer
2004-02-13 1:01 ` Michael Koehne
2004-02-13 1:24 ` Dan Shearer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040212150023.GA32317@bakunin.copyleft.de \
--to=kraehe@copyleft.de \
--cc=dan@shearer.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.