9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] got a new feature: learning of resources and switching among them
@ 2003-01-24 19:04 Fco.J.Ballesteros
  2003-01-24 21:23 ` Axel Belinfante
  2003-01-24 21:31 ` [9fans] got a new feature: learning of resources and switching among them Skip Tavakkolian
  0 siblings, 2 replies; 14+ messages in thread
From: Fco.J.Ballesteros @ 2003-01-24 19:04 UTC (permalink / raw)
  To: 9fans

Hi,

	I'm happy enough with the behaviour of this thing and would
love to know what you think of it and any suggestion you may have.  I'll
put the code in sources soon (once that it has been exercised for
some more time).

It's a couple of programs, badsrv and redirfs.  The first one runs a
kind of discovery protocol using constraints/properties to determine
which resources are of interest for you and which ones are not.  The
second one is a file server that permits the user to switch at run
time between different file trees.  It can be instructed by means of the
first program to learn for alternate file trees for a resource.

I have been using this to redirect audio output from one machine to
another without even stopping the player, and also to switch to an
alternate home directory if the current one is no longer available
(without restarting acme).

I'm sorry about the size of the mail, but here are the manual pages
for the programs.

Anyone would want to use such thing?
Other comments? 

thanks a lot

     NAME
          redirfs - File server to redirect fids from one tree to
          another

     SYNOPSIS
          redirfs [ -abcdiCD ] [ -s srv ] [ -m mnt ] dir

     DESCRIPTION
          Redirfs is a  server that mounts itself between an existing
          directory and the user.  It learns of alternate trees for
          that directory and permits the user to change the one used.
          It can be used to dinamically redirect audio, failover from
          one file server to another, choose a cdrom depending on the
          ones available, and similar tasks.

          Redirfs works in combination with badsrv(8) because that
          program can learn by itself which resources are available
          and instruct redirfs about alternate trees.  The user relies
          on the commands file serviced by redirfs to select the pre-
          ferred tree. It is suggested to use different redirfs
          instances for different resources because the current imple-
          mentation is not multithreaded and admits only a request at
          a time.

     EXAMPLE
          This exports the local audio device and discovers new audio
          devices of interest (as dictated by the configuration file
          of badsrv):

               redirfs  -s audio '#A'
               badsrv &

          Once started, this permits the selection of a different
          audio device serviced by atlantis:

               con -C /srv/audio.cmd
               % Set audio!atlantis
               %

     SEE ALSO
          badsrv(8)

     SOURCE
          /sys/src/cmd/redirfs.c

     BUGS
          This is still experimental. This page does not show the
          options available nor the commands available in the console.

     NAME
          badsrv - Broadcast based advertising service for resources

     SYNOPSIS
          badsrv [ -v ] [ -c cfg ] [ -s srv ]

     DESCRIPTION
          Badsrv is a  server that runs a broadcast based resource
          discovery protocol to inform redirfs(4) as resources come
          and go in the network.

          The protocol is very naive, but enough for a network of mod-
          erated size: It send a broadcast to announce local resources
          every few seconds. All servers receiving a broadcast reply
          to the sender to announce their own ones. If a resource
          announce is not seen in three rounds, it is garbage col-
          lected and declared as gone.

          For each resource that is either new or collected, an appro-
          priate message is sent to the control file of the redirfs in
          charge for the resource. The convention is that the same
          resource uses the same name both in redirfs and in badsrv.

          Option -v shows debug information.

          Option -c instructs badsrv to use cfg as its configuration
          file. By default the configuration is at file
          badconf.sysname.

          Option -s posts a file at srv(3) where more configuration
          commands can be sent at run time.

          The configuration file includes commands, one per line, that
          determine a resource to be announced or a resource wanted.
          Announces for unwanted resources are ignored. Each command
          has arguments using tab as a delimiter. For example,

               ad   atlantis  cdrom     L126 #S/sdC1

          announces a resource cdrom serviced by atlantis whose loca-
          tion is room 126. The file at atlantis for the cdrom is
          #S/sdC1.

               want -    audio     L126

          tells the server to pay attention to any announce for the
          resource audio if its location is at room 126.

          The constraint (eg. L126) can be more complex like in
          Tcd!Dgsyc!L126. It is made of members separated by "!",
          where the first character refers to a property (type,
          domain, location, etc.) and the following ones identify the
          value for the property. The user can define any desired
          property/value pairs. If the properties wanted do not match
          the ones offered, the announce is ignored.

     SEE ALSO
          redirfs(4)

     SOURCE
          /sys/src/cmd/badsrv

     BUGS
          This is still experimental. User interface is missing.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching  among them
  2003-01-24 19:04 [9fans] got a new feature: learning of resources and switching among them Fco.J.Ballesteros
@ 2003-01-24 21:23 ` Axel Belinfante
  2003-01-24 22:47   ` FJ Ballesteros
  2003-01-24 21:31 ` [9fans] got a new feature: learning of resources and switching among them Skip Tavakkolian
  1 sibling, 1 reply; 14+ messages in thread
From: Axel Belinfante @ 2003-01-24 21:23 UTC (permalink / raw)
  To: 9fans

> Anyone would want to use such thing?

I would like to play with it! :-)
(and see if I can even further confuse my colleagues :-)

It would be fun to see it redirect audio output from our
``coffee room plan 9 music server'' to the bitsy, and maybe
even to the sun on my desk where I use plan 9 via drawterm(*).

Hmm... could the same/something similar also be
used for a (e.g.) sound broadcasting service?
(like: send sound bytes not to one (either this or that)
 device, but to both, or all of them, or...)

(*) Via some crockery I send sound bytes from the cpu
server via drawterm to the audio device of the sun.)

Axel.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-24 19:04 [9fans] got a new feature: learning of resources and switching among them Fco.J.Ballesteros
  2003-01-24 21:23 ` Axel Belinfante
@ 2003-01-24 21:31 ` Skip Tavakkolian
  2003-01-24 21:33   ` Jack Johnson
  2003-01-24 22:35   ` FJ Ballesteros
  1 sibling, 2 replies; 14+ messages in thread
From: Skip Tavakkolian @ 2003-01-24 21:31 UTC (permalink / raw)
  To: 9fans

>                redirfs  -s audio '#A'
>                badsrv &
> 
>           Once started, this permits the selection of a different
>           audio device serviced by atlantis:
> 
>                con -C /srv/audio.cmd
>                % Set audio!atlantis
>                %

So, it should work for mice too, like this:

redirfs -s mouse '#m'

and then

con -C /srv/mouse.cmd
% Set mouse!nemosterm	# mouse input comes from nemo's
% Set mouse!skipsterm	# later from skip's

right?

How easy would it be to add a fan-out feature, perhaps only honoring
the write requests?

~~~~~~~~~~~
Skip Tavakkolian  -- Chief cook and bottle washer
9Netics - Distributed Applications Platform
http://www.9netics.com



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-24 21:31 ` [9fans] got a new feature: learning of resources and switching among them Skip Tavakkolian
@ 2003-01-24 21:33   ` Jack Johnson
  2003-01-24 22:39     ` FJ Ballesteros
  2003-01-24 22:35   ` FJ Ballesteros
  1 sibling, 1 reply; 14+ messages in thread
From: Jack Johnson @ 2003-01-24 21:33 UTC (permalink / raw)
  To: 9fans

Skip Tavakkolian wrote:
> redirfs -s mouse '#m'
> con -C /srv/mouse.cmd
> % Set mouse!nemosterm	# mouse input comes from nemo's
> % Set mouse!skipsterm	# later from skip's

Are you the April Fool's Day advance team?

I'm waiting for this to devolve into a script to ensure that 
This_Is_The_Song_That_Never_Ends.mp3 is always playing on someone's 
terminal.  Or migrating popup ads in the next Web browser iteration.

Actually, this is very, very cool stuff.  I can't wait to try it out 
this weekend.

-Jack





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-24 21:31 ` [9fans] got a new feature: learning of resources and switching among them Skip Tavakkolian
  2003-01-24 21:33   ` Jack Johnson
@ 2003-01-24 22:35   ` FJ Ballesteros
  1 sibling, 0 replies; 14+ messages in thread
From: FJ Ballesteros @ 2003-01-24 22:35 UTC (permalink / raw)
  To: 9fans

Right.
In fact, the first device I tried with before getting
into the current design was the mouse. I used it to use a mouse
to control a remote rio and it worked mostly; there´s the issue
of the hardware cursor. This thing only works for stuff that is
exported as files and has no covert channels.
One of the to-do things, although far down in the
list, is to implement an alternate file tree for a window system, in
a way that would permit redirection.

Skip Tavakkolian wrote:

>>               redirfs  -s audio '#A'
>>               badsrv &
>>
>>          Once started, this permits the selection of a different
>>          audio device serviced by atlantis:
>>
>>               con -C /srv/audio.cmd
>>               % Set audio!atlantis
>>               %
>>
> 
> So, it should work for mice too, like this:
> 
> redirfs -s mouse '#m'
> 
> and then
> 
> con -C /srv/mouse.cmd
> % Set mouse!nemosterm	# mouse input comes from nemo's
> % Set mouse!skipsterm	# later from skip's
> 
> right?
> 
> How easy would it be to add a fan-out feature, perhaps only honoring
> the write requests?
> 
> ~~~~~~~~~~~
> Skip Tavakkolian  -- Chief cook and bottle washer
> 9Netics - Distributed Applications Platform
> http://www.9netics.com
> 
> 




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-24 21:33   ` Jack Johnson
@ 2003-01-24 22:39     ` FJ Ballesteros
  0 siblings, 0 replies; 14+ messages in thread
From: FJ Ballesteros @ 2003-01-24 22:39 UTC (permalink / raw)
  To: 9fans

I'd prefer to use it for at least one more week or so before publishing
it. But if you want to try it out I'll just push it into sources next
monday in its current 'alpha' state.

> Actually, this is very, very cool stuff.  I can't wait to try it out 
> this weekend.
> 
> -Jack




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching  among them
  2003-01-24 21:23 ` Axel Belinfante
@ 2003-01-24 22:47   ` FJ Ballesteros
  2003-01-27 18:54     ` Axel Belinfante
  0 siblings, 1 reply; 14+ messages in thread
From: FJ Ballesteros @ 2003-01-24 22:47 UTC (permalink / raw)
  To: 9fans



> (and see if I can even further confuse my colleagues :-)


I implemented it because I think Plan 9 is just too simple and
wanted to get it complex.(*)


> Hmm... could the same/something similar also be
> used for a (e.g.) sound broadcasting service?
> (like: send sound bytes not to one (either this or that)
>  device, but to both, or all of them, or...)


It's more a point to point thing, since the common protocol is
9p. ads and redirections just let you plug the things together.


> (*) Via some crockery I send sound bytes from the cpu
> server via drawterm to the audio device of the sun.)
> 


The plan is actually to write some drivers in Linux and change u9fs
to let Linux export resources for us an also make it think that some
of our little trees are /dev things. But don't hold your breath :-)


---
(*) Kidding here, even if you did not think so.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-24 22:47   ` FJ Ballesteros
@ 2003-01-27 18:54     ` Axel Belinfante
  2003-01-27 20:16       ` Russ Cox
  2003-01-29  8:27       ` Fco.J.Ballesteros
  0 siblings, 2 replies; 14+ messages in thread
From: Axel Belinfante @ 2003-01-27 18:54 UTC (permalink / raw)
  To: 9fans

> > (*) Via some crockery I send sound bytes from the cpu
> > server via drawterm to the audio device of the sun.)
> 
> The plan is actually to write some drivers in Linux and change u9fs
> to let Linux export resources for us an also make it think that some
> of our little trees are /dev things. But don't hold your breath :-)

Currently, I'm using drawterm under solaris.
In solaris I just have two named pipes /tmp/dev/^(audio volume)
that in drawterm are visible as /mnt/term/tmp/dev/^(audio volume) .
In drawterm I then just ``bind -a /mnt/term/tmp/dev /dev''.
Under solaris I run two programs, one to copy sound bytes from
/tmp/dev/audio to /dev/audio, and another to interpret lines read
from /tmp/dev/volume to update the master volume via /dev/audioctl
(currently, I also need/use sox to put in the solaris audio header,
 because I somehow cannot get the copying program to do that right).
Of course, this only works in one direction
(audio output from plan9 to solaris).

I think I would prefer to see such functionality somehow integrated
in (or connected to) drawterm, in the same way as drawterm makes
other devices available to plan 9, over something that uses u9fs --
but maybe I'm overlooking something.
I assume, a problem of audio will be that a ``host driver''
probably will be pretty machine (o.s.) dependent.
Just some thoughts.

Axel.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-27 18:54     ` Axel Belinfante
@ 2003-01-27 20:16       ` Russ Cox
  2003-01-27 20:29         ` Axel Belinfante
  2003-01-28  3:33         ` Skip Tavakkolian
  2003-01-29  8:27       ` Fco.J.Ballesteros
  1 sibling, 2 replies; 14+ messages in thread
From: Russ Cox @ 2003-01-27 20:16 UTC (permalink / raw)
  To: 9fans

It's worth pointing out that the Windows drawterm
at one point provided a /dev/audio, though that 
version never made it into the distribution.

I want to build a more modular drawterm eventually.

Russ



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-27 20:16       ` Russ Cox
@ 2003-01-27 20:29         ` Axel Belinfante
  2003-01-28  3:33         ` Skip Tavakkolian
  1 sibling, 0 replies; 14+ messages in thread
From: Axel Belinfante @ 2003-01-27 20:29 UTC (permalink / raw)
  To: 9fans

> I want to build a more modular drawterm eventually.

Cool.

Please don't read my previous post as criticism on current drawterm --
I think it's pretty neat that it allows the simple named pipe trick
(crock or not) to work, and that it gets me as far as it does!

Axel.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-27 20:16       ` Russ Cox
  2003-01-27 20:29         ` Axel Belinfante
@ 2003-01-28  3:33         ` Skip Tavakkolian
  1 sibling, 0 replies; 14+ messages in thread
From: Skip Tavakkolian @ 2003-01-28  3:33 UTC (permalink / raw)
  To: 9fans

> I want to build a more modular drawterm eventually.

Would something like Inferno's '#C' device and 'os' command be useful
for drawterm?  Access to local devices could then be provided through
native helper programs.  I vaguely recall Forsyth mentioning this
approach several years ago to handle things like interfacing to
proprietary codecs.

~~~~~~~~~~~
Skip Tavakkolian -- Asistant Chief Associate VP for Title Planning
9Netics - Distributed Applications Platform
http://www.9netics.com



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] got a new feature: learning of resources and switching among them
  2003-01-27 18:54     ` Axel Belinfante
  2003-01-27 20:16       ` Russ Cox
@ 2003-01-29  8:27       ` Fco.J.Ballesteros
  2003-01-29 13:32         ` [9fans] " Jim Choate
  1 sibling, 1 reply; 14+ messages in thread
From: Fco.J.Ballesteros @ 2003-01-29  8:27 UTC (permalink / raw)
  To: 9fans

> I think I would prefer to see such functionality somehow integrated
> in (or connected to) drawterm, in the same way as drawterm makes
> other devices available to plan 9, over something that uses u9fs --
> but maybe I'm overlooking something.

If you do it that way, linux binaries can't use
a resource serviced by Plan 9. I'd like not just to use their resources,
but also to let them use ours.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [9fans] Re: got a new feature: learning of resources and switching among them
  2003-01-29  8:27       ` Fco.J.Ballesteros
@ 2003-01-29 13:32         ` Jim Choate
  2003-01-29 14:29           ` [9fans] When will we start listening to Jackass Jim? Sam
  0 siblings, 1 reply; 14+ messages in thread
From: Jim Choate @ 2003-01-29 13:32 UTC (permalink / raw)
  To: 9fans


On Wed, 29 Jan 2003, Fco.J.Ballesteros wrote:

> > I think I would prefer to see such functionality somehow integrated
> > in (or connected to) drawterm, in the same way as drawterm makes
> > other devices available to plan 9, over something that uses u9fs --
> > but maybe I'm overlooking something.
>
> If you do it that way, linux binaries can't use
> a resource serviced by Plan 9. I'd like not just to use their resources,
> but also to let them use ours.

This goes back to one of the first (if not the first question) I ever
asked on joining 9Fans a couple of years ago. A mechanism for Linux (and
other OS'es) to participate in the process space as peers, and whether anyone
was working on such a beast. I believe the commentary at that point was
some mono-OS zealotry about how nobody was interested.

My how times change.


 --
    ____________________________________________________________________

      We are all interested in the future for that is where you and I
      are going to spend the rest of our lives.

                              Criswell, "Plan 9 from Outer Space"

      ravage@ssz.com                            jchoate@open-forge.org
      www.ssz.com                               www.open-forge.org
    --------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [9fans] When will we start listening to Jackass Jim?
  2003-01-29 13:32         ` [9fans] " Jim Choate
@ 2003-01-29 14:29           ` Sam
  0 siblings, 0 replies; 14+ messages in thread
From: Sam @ 2003-01-29 14:29 UTC (permalink / raw)
  To: 9fans

>
> This goes back to one of the first (if not the first question) I ever
> asked on joining 9Fans a couple of years ago. A mechanism for Linux (and
> other OS'es) to participate in the process space as peers, and whether anyone
> was working on such a beast. I believe the commentary at that point was
> some mono-OS zealotry about how nobody was interested.
>

You're such a misunderstood, decried visionary.  Surely the angels
weep for your constant suffering.  Be strong and steadfast JJ -
the Lord will eventually smite those who oppose you.

Blessed be, JJ.  Blessed be.

Sam




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-01-29 14:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24 19:04 [9fans] got a new feature: learning of resources and switching among them Fco.J.Ballesteros
2003-01-24 21:23 ` Axel Belinfante
2003-01-24 22:47   ` FJ Ballesteros
2003-01-27 18:54     ` Axel Belinfante
2003-01-27 20:16       ` Russ Cox
2003-01-27 20:29         ` Axel Belinfante
2003-01-28  3:33         ` Skip Tavakkolian
2003-01-29  8:27       ` Fco.J.Ballesteros
2003-01-29 13:32         ` [9fans] " Jim Choate
2003-01-29 14:29           ` [9fans] When will we start listening to Jackass Jim? Sam
2003-01-24 21:31 ` [9fans] got a new feature: learning of resources and switching among them Skip Tavakkolian
2003-01-24 21:33   ` Jack Johnson
2003-01-24 22:39     ` FJ Ballesteros
2003-01-24 22:35   ` FJ Ballesteros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).