.TH WATCHER 1 .SH NAME watcher \- octopus watcher for network gadget arrival and departure .SH SYNOPSIS .B watcher [ .B \-dv ] [ .B -i .I ival ] [ .B \-t .I tmout ] [ .B -r .I regdir ] .SH DESCRIPTION .I Watcher watches out the registry to detect and notify of arrivals and departures of network gadgets in the octopus. It opens .B /mnt/registry/event to detect changes in the registry (or uses that at .I regdir when .B -r is given). Also, it scans the directory every .I ival milliseconds (60000 by default) to detect entries not refreshed (with modification time older than .I tmout seconds, 60 by default). .PP For each new entry in the registry with value .B ofs for the .B name attribute .I watcher plumbs a message notifying the arrival of the terminal whose name is reported by the .B sys attribute as found in the entry. When such entry is gone (either due to lack of refresh or due to removal from the registry) .I watcher plumbs a message notifying the departure of the terminal. Messages are plumbed both via .IR plumber (8) and vid .IR ports (4). .PP Also, upon departure of a terminal, .I watcher kills the entire process group of the process whose PID was reported in the .B pid attribue of the .B ofs entry. This is done to force all resources imported from a (no longer working) gone terminal to be discarded. Besides, .I watcher tries to unmount the terminal from .B /devs (just in case). .PP Only entries with registry names starting with .B o! are timed out. That is the naming convention used by .IR netget (1) to register network gadgets. Giving zero in .I tmout disables the time out mechanism. .PP Flag .B -v makes the program a little verbose, to report arrivals and departures. Flag .B -d makes the program quite verbose, for debugging. .SH SOURCE .B /usr/octopus/port/watcher.b .SH SEE ALSO .IR netget (1), .IR mux (4).