blob: 21a548a39e500afbfc81444bb4a2d346ce4bf1cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
}
|