From e56b5ef0bbec1c22df1f8f82d4e75ec1785fc2ea Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Tue, 24 Mar 2009 01:13:21 +0000 Subject: [PATCH] --- main.ml | 1 + unixsocketwatcher.ml | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.ml b/main.ml index 872dc59..907d65e 100644 --- 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; diff --git a/unixsocketwatcher.ml b/unixsocketwatcher.ml index f997156..01cc0b6 100644 --- a/unixsocketwatcher.ml +++ b/unixsocketwatcher.ml @@ -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 -- 2.43.0