Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all MTT Devel mailing list

Subject: Re: [MTT devel] [MTT svn] svn:mtt-svn r1385
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2011-02-23 09:20:45


Rainer --

This is not enough; you also need to close stdin, stdout, and stderr. I also don't think we want to print something to stdout from the child -- it's a race condition.

On Feb 23, 2011, at 9:17 AM, rusraink_at_[hidden] wrote:

> Author: rusraink
> Date: 2011-02-23 09:17:50 EST (Wed, 23 Feb 2011)
> New Revision: 1385
> URL: https://svn.open-mpi.org/trac/mtt/changeset/1385
>
> Log:
> - Add --daemon parameter to fork mtt-relay into background.
>
>
> Text files modified:
> trunk/client/mtt-relay | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> Modified: trunk/client/mtt-relay
> ==============================================================================
> --- trunk/client/mtt-relay (original)
> +++ trunk/client/mtt-relay 2011-02-23 09:17:50 EST (Wed, 23 Feb 2011)
> @@ -23,6 +23,7 @@
> chomp $HOST;
>
> my $PORT = "8008";
> +my $daemon = 0;
> my $debug = 0;
> my $quiet = 0;
> my $url = 'https://www.open-mpi.org/mtt/submit/index.php';
> @@ -32,6 +33,7 @@
> Getopt::Long::GetOptions(
> "port|p=i" => \$PORT,
> "host|h=s" => \$HOST,
> + "daemon" => \$daemon,
> "debug|d" => \$debug,
> "url|u=s" => \$url,
> "help" => \$help,
> @@ -44,6 +46,7 @@
> --port|-p Port that $0 listens on (default: $PORT)
> --host|-h Specify $0's host (default: $HOST)
> --url|-u MTT results submission URL (default: $url)
> + --daemon Daemon mode (fork into background)
> --debug|-d Debug mode
> --help This message
> EOT
> @@ -96,6 +99,16 @@
> print "Set your proxy to <URL:" . $master->url . ">\n";
> my $slave;
>
> + if ($daemon) {
> + my $pid = fork();
> + if($pid) {
> + print "# Daemon Parent exiting\n";
> + exit 0;
> + } else {
> + print "# Daemon Child process continuing\n";
> + }
> + }
> +
> while (1) {
> while ($slave = $master->accept) {
> &handle_connection($slave);
> _______________________________________________
> mtt-svn mailing list
> mtt-svn_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-svn

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/