(no commit message)
authorSapan Bhatia <sapanb@cs.princeton.edu>
Tue, 24 Mar 2009 01:13:21 +0000 (01:13 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Tue, 24 Mar 2009 01:13:21 +0000 (01:13 +0000)
main.ml
unixsocketwatcher.ml

diff --git a/main.ml b/main.ml
index 872dc59..907d65e 100644 (file)
--- a/main.ml
+++ b/main.ml
@@ -15,6 +15,7 @@ let cmdspeclist =
   [
     ("-daemon",Arg.Set(daemonize), "Daemonize");
     ("-conffile",Arg.Set_string(Globals.conffile), "Config file");
+    ("-logfile",Arg.Set_string(Globals.log_filepath), "Log file");
     ("-backend",Arg.Set_string(Globals.backend), "Backend directory");
     ("-frontend",Arg.Tuple[Arg.String(fun s->cur_dir:=s);
                            Arg.String(fun s->cur_slice:=s;
index f997156..01cc0b6 100644 (file)
@@ -56,9 +56,14 @@ let receive_event (listening_socket_spec:fname_and_fd) (_:fname_and_fd) =
                 match entry_info with
                   | Some(execpath,slice_name,fd) ->
                       begin
-
-
-
+                        let child = fork () in
+                          if (child == 0) then
+                               begin
+                                 (*Child*)
+                                 (* Close all fds except for the socket *)
+                                 execv execpath,[execpath];
+                                 logprint "Could not execve %s" execpath
+                               end
                       end
                   | None -> ()
             end