- Dirwatcher.initialize ();
- Fifowatcher.initialize ();
- let felst = List.map (fun lst->new frontendHandler lst) !input_file_list in
- let _ = new backendHandler !Globals.backend felst in
- Fdwatcher.start_watch ()
+ if (!daemonize) then
+ begin
+ print "Daemonizing\n";
+ let child = Unix.fork () in
+ if (child <> 0) then
+ begin
+ let pidfile = open_out !Globals.pid_filepath in
+ fprintf pidfile "%d" child;
+ close_out pidfile;
+ exit(0)
+ end
+ end;
+
+ Dirwatcher.initialize ();
+ Directfifowatcher.initialize ();
+
+ if (!Globals.conffile <> "") then
+ begin
+ let frontends = Conffile.read_frontends !Globals.conffile in
+ input_file_list:=List.concat [!input_file_list;frontends]
+ end;
+
+ let felst = List.map
+ (fun lst->let (x,y)=lst in
+ logprint "Slice %s (%s)\n" x y;
+ new frontendHandler lst)
+ !input_file_list in
+ let _ = new backendHandler !Globals.backend felst in
+ Fdwatcher.start_watch ()