diff --git a/src/common/slurm_return_codes.h b/src/common/slurm_return_codes.h
index 99e2b1c45bef3c2cbbf652fe26029c867402d135..f9922b14306962cbd3279f0a4f87a6dc74a6fd94 100644
--- a/src/common/slurm_return_codes.h
+++ b/src/common/slurm_return_codes.h
@@ -5,5 +5,6 @@
 #define SLURM_SUCCESS 0
 #define SLURM_ERROR -1 
 #define SLURM_FAILURE -1
-
+/* to mimick bash on task launch failure*/
+#define SLURM_EXIT_FAILURE_CODE 127
 #endif
diff --git a/src/slurmd/slurmd.c b/src/slurmd/slurmd.c
index 9423ea85eb84bfbb73010f7ed7746297b814f92f..67655b922be874c763f24ccf5f121c5adfa1eb9e 100644
--- a/src/slurmd/slurmd.c
+++ b/src/slurmd/slurmd.c
@@ -270,24 +270,25 @@ void slurmd_req ( slurm_msg_t * msg )
 void slurm_rpc_launch_tasks ( slurm_msg_t * msg )
 {
 	/* init */
-	int error_code;
+	int error_code = SLURM_SUCCESS ;
 	clock_t start_time;
 	launch_tasks_request_msg_t * task_desc = ( launch_tasks_request_msg_t * ) msg->data ;
 	slurm_msg_t resp_msg ;
 	launch_tasks_response_msg_t task_resp ;
 	char node_name[MAX_NAME_LEN];
 
+	start_time = clock ();
+	info ("slurmd_req: launch tasks message received");
+
 	slurm_print_launch_task_msg ( task_desc ) ;
 
 	/* get nodename */
 	if ( ( error_code = getnodename (node_name, MAX_NAME_LEN) ) )
 		fatal ("slurmd: errno %d from getnodename", errno);
 
-	start_time = clock ();
-	info ("slurmd_req: launch tasks message received");
 
 	/* do RPC call */
-	error_code = launch_tasks ( task_desc );
+	/* test credentials */
 
 	task_resp . return_code = error_code ;
 	task_resp . node_name = node_name ;
@@ -306,10 +307,12 @@ void slurm_rpc_launch_tasks ( slurm_msg_t * msg )
 	}
 	else
 	{
-		info ("slurmd_req: launch tasks completed successfully, time=%ld", 
+		info ("slurmd_req: launch authorization completed successfully, time=%ld", 
 				(long) (clock () - start_time));
 		slurm_send_only_node_msg ( & resp_msg );
 	}
+	
+	error_code = launch_tasks ( task_desc );
 
 }
 
diff --git a/src/slurmd/task_mgr.c b/src/slurmd/task_mgr.c
index 2325846ed4f3c7d7f2692e820fb815770051de54..c32235552259b66ebfdd42df2405372d1a952fcb 100644
--- a/src/slurmd/task_mgr.c
+++ b/src/slurmd/task_mgr.c
@@ -565,7 +565,8 @@ void * task_exec_thread ( void * arg )
 			close ( STDIN_FILENO );
 			close ( STDOUT_FILENO );
 			close ( STDERR_FILENO );
-			_exit ( SLURM_SUCCESS ) ;
+			error("execve(): %s: %m", launch_msg->argv[0]);
+			_exit ( SLURM_EXIT_FAILURE_CODE ) ;
 			break;
 			
 		default: /*parent proccess */