]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
move daemonize as a command line argument
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Thu, 16 Jul 2009 09:01:12 +0000 (10:01 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Thu, 16 Jul 2009 09:01:12 +0000 (10:01 +0100)
xenvm/xenvm.ml

index 3a52ae41c87138dadbdf49d18b7eceac6ae8a7d8..59959d4720298b26db9e757e6473b5de5d07ef2e 100644 (file)
@@ -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 <config>] [--uuid <uuid>] [<config>-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 (