* [uml-devel] Which UPS simulator?
@ 2004-02-12 5:28 Dan Shearer
2004-02-12 15:00 ` Michael Koehne
0 siblings, 1 reply; 5+ messages in thread
From: Dan Shearer @ 2004-02-12 5:28 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: selinger
I propose using a standard UPS interface as a way for mconsole to
trigger a full system shutdown. I don't know the UPS market well and am
hoping someone can point me a to a more open protocol that what I've
found so far. This doesn't solve the bigger problem of UML control from
mconsole, but it addresses one immediate need.
The key thing is that this doesn't require the user of the uml to use
any special software or configurations, which in turn means I don't have
to give anyone any more training than a URL for standard Linux UPS
software.
http://quasar.mathstat.uottawa.ca/~selinger/ups/simulator.c is easy to
find. It mostly implements an informally documented protocol
(http://quasar.mathstat.uottawa.ca/~selinger/ups/belkin-universal-ups.html)
and is GPLd. Some slight mods in how the communications happen and this
could be how mconsole talks to a ups daemon listening on one of the
virtual serial ports. Not sure if this includes upsd that comes with
many distros however this UPS is listed as supported at
http://eu1.networkupstools.org.
Anyone know of a simulator for a more open/more appropriate UPS protocol
that is understood by more than one of the open source UPS daemons?
--
Dan Shearer
dan@shearer.org
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Which UPS simulator?
2004-02-12 5:28 [uml-devel] Which UPS simulator? Dan Shearer
@ 2004-02-12 15:00 ` Michael Koehne
2004-02-12 23:08 ` Dan Shearer
0 siblings, 1 reply; 5+ messages in thread
From: Michael Koehne @ 2004-02-12 15:00 UTC (permalink / raw)
To: Dan Shearer, user-mode-linux-devel
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [uml-devel] Which UPS simulator?
2004-02-12 15:00 ` Michael Koehne
@ 2004-02-12 23:08 ` Dan Shearer
2004-02-13 1:01 ` Michael Koehne
0 siblings, 1 reply; 5+ messages in thread
From: Dan Shearer @ 2004-02-12 23:08 UTC (permalink / raw)
To: Michael Koehne; +Cc: user-mode-linux-devel
On Thu, Feb 12, 2004 at 04:00:23PM +0100, Michael Koehne wrote:
> 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.
That is exactly what I want to avoid. I want a more accurate UML where
no UML-specific logic is needed for communication -- from one point of
view that is what communication is all about. There are plenty of ways
of introducing new communications methods (such as you have done, or a
special listening port, etc) into the UML.
--
Dan Shearer
dan@shearer.org
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Which UPS simulator?
2004-02-12 23:08 ` Dan Shearer
@ 2004-02-13 1:01 ` Michael Koehne
2004-02-13 1:24 ` Dan Shearer
0 siblings, 1 reply; 5+ messages in thread
From: Michael Koehne @ 2004-02-13 1:01 UTC (permalink / raw)
To: Dan Shearer, user-mode-linux-devel
Moin Dan Shearer,
> That is exactly what I want to avoid. I want a more accurate UML where
> no UML-specific logic is needed for communication -- from one point of
> view that is what communication is all about. There are plenty of ways
> of introducing new communications methods (such as you have done, or a
> special listening port, etc) into the UML.
implementing an UPS would also only require existing uml technics, as
APC and Berkin UPS are talking to a serial line. But it would require
some special program running inside and outside your UML, while my
simple script only require to cad line to be right.
see http://quasar.mathstat.uottawa.ca/~selinger/ups/simulator.c
for Berkin simulator and demons, or reference apcupsd for APC
and reverse enginier a simulator.
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Which UPS simulator?
2004-02-13 1:01 ` Michael Koehne
@ 2004-02-13 1:24 ` Dan Shearer
0 siblings, 0 replies; 5+ messages in thread
From: Dan Shearer @ 2004-02-13 1:24 UTC (permalink / raw)
To: Michael Koehne; +Cc: user-mode-linux-devel
On Fri, Feb 13, 2004 at 02:01:27AM +0100, Michael Koehne wrote:
> Moin Dan Shearer,
>
> > That is exactly what I want to avoid. I want a more accurate UML where
> > no UML-specific logic is needed for communication -- from one point of
> > view that is what communication is all about. There are plenty of ways
> > of introducing new communications methods (such as you have done, or a
> > special listening port, etc) into the UML.
>
> implementing an UPS would also only require existing uml technics, as
> APC and Berkin UPS are talking to a serial line. But it would require
> some special program running inside and outside your UML, while my
> simple script only require to cad line to be right.
Just depends on what you want to achive. You are correct, but your way
requires something different to real life. My point remains that a UML
user with root has only to run "some special program" that is a standard
UPS tool that he can read about in any Linux reference.
> see http://quasar.mathstat.uottawa.ca/~selinger/ups/simulator.c
> for Berkin simulator and demons, or reference apcupsd for APC
> and reverse enginier a simulator.
Read my original message, where I quoted exactly this URL (and Cc'd the
author.)
--
Dan Shearer
dan@shearer.org
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-02-13 1:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-12 5:28 [uml-devel] Which UPS simulator? Dan Shearer
2004-02-12 15:00 ` Michael Koehne
2004-02-12 23:08 ` Dan Shearer
2004-02-13 1:01 ` Michael Koehne
2004-02-13 1:24 ` Dan Shearer
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.