From: Vincent Hanquez Date: Thu, 16 Jul 2009 09:01:12 +0000 (+0100) Subject: move daemonize as a command line argument X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7c32e423dfb4990a10b7c1fc49744dbcde0b8261;p=xenclient%2Ftoolstack.git move daemonize as a command line argument --- diff --git a/xenvm/xenvm.ml b/xenvm/xenvm.ml index 3a52ae4..59959d4 100644 --- a/xenvm/xenvm.ml +++ b/xenvm/xenvm.ml @@ -717,12 +717,14 @@ let () = let strict_config = ref false in let config_errors = ref [] in let uuid = ref "" in + let daemonize = ref true in let usage_msg = sprintf "usage: %s [--config ] [--uuid ] [-deprecated]" Sys.argv.(0) in Arg.parse [ ("--config", Arg.Set_string config, "Set config file to be used"); ("--uuid", Arg.Set_string uuid, "Force uuid to be the one specified"); ("--strict-config", Arg.Set strict_config, "Error out if the config contains errors"); + ("--no-daemonize", Arg.Clear daemonize, "leave the daemon in foreground"); ] (fun s -> anon := s :: !anon) usage_msg; if !config = "" && List.length !anon > 0 then ( @@ -749,7 +751,7 @@ let () = verify_config cfg; - if cfg.daemonize then + if !daemonize then Unixext.daemonize (); if cfg.debug then (