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 ("-logfile",Arg.Set_string(Globals.log_filepath), "Log file");
19 ("-backend",Arg.Set_string(Globals.backend), "Backend directory");
20 ("-frontend",Arg.Tuple[Arg.String(fun s->cur_dir:=s);
21 Arg.String(fun s->cur_slice:=s;
22 input_file_list:=(!cur_dir,!cur_slice)::!input_file_list)],
23 "frontendN,slicenameN");
24 ("-nochroot",Arg.Set(Globals.nochroot), "Run in non-chroot environment");
25 ("-failsafe",Arg.Set(Globals.failsafe), "Never crash. Be stupid, but never crash. Use at your own risk.");
29 Arg.parse cmdspeclist (fun x->()) "Usage: vsys <list of mount points>";
30 Globals.logfd:=open_out_gen [Open_append;Open_creat] 0o644 !log_filepath;
31 if (!Globals.backend == "") then
32 printf "Try vsys --help\n"
35 logprint "Starting Vsys v%s\n" Globals.vsys_version;
38 print "Daemonizing\n";
39 let child = Unix.fork () in
42 let pidfile = open_out !Globals.pid_filepath in
43 fprintf pidfile "%d" child;
49 Dirwatcher.initialize ();
50 Directfifowatcher.initialize ();
52 if (!Globals.conffile <> "") then
54 let frontends = Conffile.read_frontends !Globals.conffile in
55 input_file_list:=List.concat [!input_file_list;frontends]
59 (fun lst->let (x,y)=lst in
60 logprint "Slice %s (%s)\n" x y;
61 new frontendHandler lst)
63 let _ = new backendHandler !Globals.backend felst in
64 Fdwatcher.start_watch ()