From 46439007cf417cbd9ac8049bb4122c890097a0fa Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 20:52:35 +0000 Subject: 20060303-partial --- dis/demo/cpupool/regpoll.dis | Bin 0 -> 904 bytes dis/demo/cpupool/runrstyx | 50 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 dis/demo/cpupool/regpoll.dis create mode 100755 dis/demo/cpupool/runrstyx (limited to 'dis/demo/cpupool') diff --git a/dis/demo/cpupool/regpoll.dis b/dis/demo/cpupool/regpoll.dis new file mode 100644 index 00000000..d64a7a55 Binary files /dev/null and b/dis/demo/cpupool/regpoll.dis differ diff --git a/dis/demo/cpupool/runrstyx b/dis/demo/cpupool/runrstyx new file mode 100755 index 00000000..21a548a3 --- /dev/null +++ b/dis/demo/cpupool/runrstyx @@ -0,0 +1,50 @@ +#!/dis/sh +fn bindfs { + # this may be useful as a general purpose cmd + (mntpt dirs)=$* + memfs $mntpt + for d in $dirs { + parts=${split / $d} + fpath='' + for p in $parts { + fpath=$fpath^/^$p + if {! ftest -e $mntpt^$fpath} { + if {ftest -d $fpath} { + mkdir $mntpt^$fpath + } { + if {! ftest -e $fpath} { + echo $fpath does not exist >[1=2] + raise 'fail:errors' + } + } + } + } + if {! ftest -d $d} { + touch $mntpt/$d + } + bind $d $mntpt^$d + } +} + +fn x { + echo tcp!^$2 +} + +bindfs /tmp /dis /n/client /dev /prog +listen -A `{x `{ndb/csquery tcp!^`{cat /dev/sysname}^!rstyx}} { + @{ + load std + pctl forkns nodevs + bind /tmp / + runas rstyx {auxi/rstyxd} + }& + } + +while {} { + demo/cpupool/regpoll tcp!200.1.1.104!6676 up + echo Registering Rstyx service + mount -A 'tcp!200.1.1.104!6676' /mnt/registry + echo `{x `{ndb/csquery tcp!^`{cat /dev/sysname}^!rstyx}} proto styx auth none persist 1 resource '''Rstyx resource''' name `{cat /dev/sysname} > /mnt/registry/new + demo/cpupool/regpoll tcp!200.1.1.104!6676 down + echo Registry gone down +} \ No newline at end of file -- cgit v1.2.3