9 let input_file_list = ref []
11 let cur_slice = ref ""
12 let daemonize = ref false
16 ("-daemon",Arg.Set(daemonize), "Daemonize");
17 ("-conffile",Arg.Set_string(Globals.conffile), "Config file");
18 ("-backend",Arg.Set_string(Globals.backend), "Backend directory");
19 ("-frontend",Arg.Tuple[Arg.String(fun s->cur_dir:=s);Arg.String(fun s->cur_slice:=s;input_file_list:=(!cur_dir,!cur_slice)::!input_file_list)], "frontendN,slicenameN");
20 ("-nochroot",Arg.Set(Globals.nochroot), "Run in non-chroot environment")
26 printf "Vsys v%s\n" Globals.vsys_version;flush stdout;
27 Arg.parse cmdspeclist (fun x->()) "Usage: vsys <list of mount points>";
28 if (!Globals.backend == "") then
29 printf "Try vsys --help\n"
34 printf "Daemonizing\n";flush Pervasives.stdout;
35 let child = Unix.fork () in
38 let pidfile = open_out !Globals.pid_filepath in
39 fprintf pidfile "%d" child;
45 Dirwatcher.initialize ();
46 Directfifowatcher.initialize ();
48 if (!Globals.conffile <> "") then
50 let frontends = Conffile.read_frontends !Globals.conffile in
51 input_file_list:=List.concat [!input_file_list;frontends]
54 let felst = List.map (fun lst->let (x,y)=lst in fprintf logfd "Slice %s (%s)\n" x y;flush logfd;new frontendHandler lst) !input_file_list in
55 let _ = new backendHandler !Globals.backend felst in
56 Fdwatcher.start_watch ()