Use more familiar HTB instead of TBF
[vsys.git] / README
1 How to use vsys
2 ---------------
3
4 Every instance of vsys has 1 backend and several frontends. The backend is a directory in which the scripts are stored.
5 The frontends are directories in which these scripts appear as pipes and can be used to command and communicate with the
6 scripts.
7
8 eg. in a Vserver environment, the backed could be a /vsys directory in root context and a frontend could be chrooted directories of vserver hosts (eg. /vservers/pl_netflow). vsys is started as:
9
10 vsys -backend <backend dir> -conffile <someconffile> 
11
12 conffile contains the list of frontends, in the format <directory> <slice name> with each entry on a newline.
13
14 A script can communicate with the process in the slice that's invoking it by reading from stdin and writing to stdout, both of which are connected to the pipe inside of the slice. If the stdout part of the pipe is not opened by the slice, then the output of the script is directed into the log file. stderr is treated in the same way.
15
16 To summarize the properties of a vsys script:
17
18 cmdline: 
19         - first argument : name of slice, specified as part of the frontends
20
21 stdin:
22         - input from the slice
23
24 stdout: 
25         - output to the slice
26
27
28 eg. if the following script: 
29
30 #!/bin/sh
31
32 read a
33 echo $a $1
34
35 were to be called foo, then it would show up in the frontends as two pipe files: foo.in, the input pipe and foo.out, the output pipe. to invoke the script, the slice would write data into foo.in, and to receive the output of the script, it would
36 read from foo.out. 
37
38 scripts are deployed and removed dynamically. if you copy foo into the backend, foo.in and foo.out will show pu immediately.
39 scripts can be organized as directories. eg. mkdir bla in the backend will cause a directory to be created in the frontend.
40
41 access to vsys scripts can be controlled through acls. an acl has the following format:
42
43 name: <scriptname>.acl (so if your script is called foo, then the acl will be
44 called foo.acl). The acl for a script must be located in the same directory as the script (not in
45 a parent or sub directory). It should be ***CREATED BEFORE THE SCRIPT***. 
46
47 contents: names of slices on new lines
48
49
50
51
52
53
54 check