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");
21 ("-failsafe",Arg.Set(Globals.failsafe), "Never crash. Be stupid, but never crash. Use at your own risk.");
27 printf "Vsys v%s\n" Globals.vsys_version;flush stdout;
28 Arg.parse cmdspeclist (fun x->()) "Usage: vsys <list of mount points>";
29 if (!Globals.backend == "") then
30 printf "Try vsys --help\n"
35 printf "Daemonizing\n";flush Pervasives.stdout;
36 let child = Unix.fork () in
39 let pidfile = open_out !Globals.pid_filepath in
40 fprintf pidfile "%d" child;
46 Dirwatcher.initialize ();
47 Directfifowatcher.initialize ();
49 if (!Globals.conffile <> "") then
51 let frontends = Conffile.read_frontends !Globals.conffile in
52 input_file_list:=List.concat [!input_file_list;frontends]
55 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
56 let _ = new backendHandler !Globals.backend felst in
57 Fdwatcher.start_watch ()