--- source-trees/gt2-cvs/gram/jobmanager/setup/condor/condor.in 11 Dec 2007 01:46:50 -0000 1.15.6.9 +++ source-trees/gt2-cvs/gram/jobmanager/setup/condor/condor.in 30 Jan 2008 21:05:42 -0000 @@ -125,6 +125,14 @@ my $multi_output = 0; my $failure_text = ''; + # Reject jobs that want streaming, if so configured + if ( $description->streamingrequested() && + $description->streamingdisabled() ) { + + $self->log("Streaming is not allowed."); + return Globus::GRAM::Error::OPENING_STDOUT; + } + if($description->jobtype() eq 'single' || $description->jobtype() eq 'multiple') { --- source-trees/gt2-cvs/gram/jobmanager/setup/fork/fork.in 12 Mar 2007 13:58:33 -0000 1.20.4.4 +++ source-trees/gt2-cvs/gram/jobmanager/setup/fork/fork.in 30 Jan 2008 21:07:09 -0000 @@ -73,6 +73,7 @@ my $fork_starter = "$ENV{GLOBUS_LOCATION}/libexec/globus-fork-starter"; my $fork_conf = "$ENV{GLOBUS_LOCATION}/etc/globus-fork.conf"; my $log_path = '/dev/null'; + my $is_grid_monitor = 0; if (-r $fork_conf) { @@ -184,6 +185,30 @@ $description->directory() . '/' . $description->executable()); + } + + # Check if this is the Condor-G grid monitor + my $exec = $description->executable(); + my $file_out = `/usr/bin/file $exec`; + if ( $file_out =~ /script/ || $file_out =~ /text/ || + $file_out =~ m|/usr/bin/env| ) { + open( EXEC, "<$exec" ) or + return Globus::GRAM::Error::EXECUTABLE_PERMISSIONS(); + while( ) { + if ( /Sends results from the grid_manager_monitor_agent back to a/ ) { + $is_grid_monitor = 1; + } + } + close( EXEC ); + } + + # Reject jobs that want streaming, if so configured, but not for + # grid monitor jobs + if ( $description->streamingrequested() && + $description->streamingdisabled() && !$is_grid_monitor ) { + + $self->log("Streaming is not allowed."); + return Globus::GRAM::Error::OPENING_STDOUT; } @arguments = $description->arguments(); --- source-trees/gt2-cvs/gram/jobmanager/setup/lsf/lsf.in 12 Jun 2007 20:44:09 -0000 1.19.6.6 +++ source-trees/gt2-cvs/gram/jobmanager/setup/lsf/lsf.in 30 Jan 2008 21:08:47 -0000 @@ -42,6 +42,14 @@ $self->log('Entering lsf submit'); + # Reject jobs that want streaming, if so configured + if ( $description->streamingrequested() && + $description->streamingdisabled() ) { + + $self->log("Streaming is not allowed."); + return Globus::GRAM::Error::OPENING_STDOUT; + } + # check jobtype if(defined($description->jobtype())) { --- source-trees/gt2-cvs/gram/jobmanager/setup/pbs/pbs.in 7 Aug 2007 16:23:01 -0000 1.18.6.10 +++ source-trees/gt2-cvs/gram/jobmanager/setup/pbs/pbs.in 30 Jan 2008 21:13:07 -0000 @@ -52,6 +52,14 @@ $self->log("Entering pbs submit"); + # Reject jobs that want streaming, if so configured + if ( $description->streamingrequested() && + $description->streamingdisabled() ) { + + $self->log("Streaming is not allowed."); + return Globus::GRAM::Error::OPENING_STDOUT; + } + # check jobtype if(defined($description->jobtype())) { --- source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager.h 17 May 2007 16:31:59 -0000 1.37.4.2 +++ source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager.h 30 Jan 2008 21:15:18 -0000 @@ -385,6 +385,20 @@ globus_gass_cache_t cache_handle; char * cache_tag; + /** + * Streaming + * + * streaming_disabled is set from the config option -disable-streaming. + * The default is false. + * streaming_requested is set to true if there's at least one remote + * destination for stdout or stderr. Otherwise, it's false. + * Both values get passed to the batch system shell script to decide + * whether to allow the job. This lets admins disable streaming for + * most jobs, but allow it for certain ones (e.g. the grid monitor). + */ + globus_bool_t streaming_disabled; + globus_bool_t streaming_requested; + globus_rsl_t * stdout_position_hack; globus_rsl_t * stderr_position_hack; --- source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager_output.c 18 Apr 2005 21:39:08 -0000 1.16 +++ source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager_output.c 7 Feb 2006 00:00:38 -0000 @@ -1737,6 +1737,7 @@ break; case GLOBUS_GRAM_JOB_MANAGER_OUTPUT_GASS: + request->streaming_requested = GLOBUS_TRUE; rc = globus_gass_transfer_register_append( &destination->handle.gass, GLOBUS_NULL, @@ -1764,6 +1765,7 @@ break; case GLOBUS_GRAM_JOB_MANAGER_OUTPUT_FTP: + request->streaming_requested = GLOBUS_TRUE; globus_ftp_client_operationattr_init(&attr); globus_ftp_client_operationattr_set_append( &attr, --- source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager_request.c Mon Jun 11 13:24:24 2007 +++ source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager_request.c.new Mon Jun 11 13:24:09 2007 @@ -94,6 +94,8 @@ globus_cond_init(&r->cond, GLOBUS_NULL); r->extra_envvars = GLOBUS_NULL; r->response_context = GSS_C_NO_CONTEXT; + r->streaming_disabled = GLOBUS_FALSE; + r->streaming_requested = GLOBUS_FALSE; r->disable_duct = GLOBUS_FALSE; r->seg_module = NULL; --- source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager_script.c 12 Mar 2007 14:03:17 -0000 1.13.4.3 +++ source-trees/gt2-cvs/gram/jobmanager/source/globus_gram_job_manager_script.c 30 Jan 2008 21:17:29 -0000 @@ -2238,6 +2238,11 @@ request->job_dir); } + fprintf(fp, ",\n 'streamingdisabled' => [ %d ]", + request->streaming_disabled ); + fprintf(fp, ",\n 'streamingrequested' => [ %d ]", + request->streaming_requested ); + globus_l_gram_job_manager_print_staging_list( request, fp, --- source-trees/gt2-cvs/gram/jobmanager/source/main.c 17 May 2007 16:31:59 -0000 1.12.4.2 +++ source-trees/gt2-cvs/gram/jobmanager/source/main.c 30 Jan 2008 21:20:43 -0000 @@ -397,6 +397,10 @@ { request->globus_version = argv[++i]; } + else if (strcmp(argv[i], "-disable-streaming") == 0) + { + request->streaming_disabled = GLOBUS_TRUE; + } else if ((strcasecmp(argv[i], "-help" ) == 0) || (strcasecmp(argv[i], "--help") == 0)) {