11/*
2- This file is part of Spindle. For copyright information see the COPYRIGHT
3- file in the top level directory, or at
2+ This file is part of Spindle. For copyright information see the COPYRIGHT
3+ file in the top level directory, or at
44https://github.com/hpc/Spindle/blob/master/COPYRIGHT
55
66This program is free software; you can redistribute it and/or modify it under
77the terms of the GNU Lesser General Public License (as published by the Free Software
88Foundation) version 2.1 dated February 1999. This program is distributed in the
99hope that it will be useful, but WITHOUT ANY WARRANTY; without even the IMPLIED
10- WARRANTY OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms
11- and conditions of the GNU Lesser General Public License for more details. You should
12- have received a copy of the GNU Lesser General Public License along with this
10+ WARRANTY OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms
11+ and conditions of the GNU Lesser General Public License for more details. You should
12+ have received a copy of the GNU Lesser General Public License along with this
1313program; if not, write to the Free Software Foundation, Inc., 59 Temple
1414Place, Suite 330, Boston, MA 02111-1307 USA
1515*/
@@ -93,7 +93,7 @@ static int spindle_in_session_mode(flux_t *flux_handle, int *argc, char ***argv)
9393 int result ;
9494 int spaces , i ;
9595 char * s ;
96-
96+
9797 result = fluxmgr_get_bootstrap (flux_handle , (argc && argv ) ? & bootstrap_str : NULL );
9898 if (result == -1 ) {
9999 err_printf (1 , "Could not get bootstrap args from flux\n" );
@@ -120,7 +120,7 @@ static int spindle_in_session_mode(flux_t *flux_handle, int *argc, char ***argv)
120120 (* argv )[i ] = NULL ;
121121 assert (i <= spaces );
122122 * argc = i ;
123-
123+
124124 return 1 ;
125125}
126126
@@ -263,16 +263,16 @@ static int run_spindle_backend (struct spindle_ctx *ctx)
263263 debug_printf (1 , "Spindle disabled. Not starting BE\n" );
264264 return 0 ;
265265 }
266-
266+
267267 ctx -> backend_pid = fork ();
268268 if (ctx -> backend_pid == 0 ) {
269269 enableSpindleForceExitBE ();
270270
271- /* Set signal handlers for ctrl-c and related signals. */
271+ /* Set signal handlers for ctrl-c and related signals. */
272272 signal (SIGINT , onTermSignal );
273273 signal (SIGTERM , onTermSignal );
274274 signal (SIGALRM , onAlarm );
275-
275+
276276 sigprocmask (SIG_BLOCK , NULL , & sset );
277277 sigdelset (& sset , SIGINT );
278278 sigdelset (& sset , SIGTERM );
@@ -320,7 +320,7 @@ static void wait_for_shell_init (flux_future_t *f, void *arg)
320320 json_t * o ;
321321 const char * event ;
322322 const char * name ;
323- int rc = -1 ;
323+ int rc = -1 ;
324324
325325 if (ctx -> params .opts & OPT_OFF ) {
326326 return ;
@@ -595,7 +595,7 @@ static int sp_init (flux_plugin_t *p,
595595 //Session mode does not need to start FE or server
596596 return 0 ;
597597 }
598-
598+
599599 /* Fill in the spindle_args_t with defaults from Spindle.
600600 * We use fillInSpindleArgsCmdlineFE() here so that spindle does
601601 * not overwrite our already-initialized `number`, which must be
@@ -620,7 +620,7 @@ static int sp_init (flux_plugin_t *p,
620620 if (!spindle_is_enabled (ctx )) {
621621 return 0 ;
622622 }
623-
623+
624624 /* N.B. Override unique_id with id again to be sure it wasn't changed
625625 * (Occaisionally see hangs if this is not done)
626626 */
@@ -649,7 +649,7 @@ static int sp_init (flux_plugin_t *p,
649649 * rank 0, but code is simpler if we treat all ranks the same.
650650 */
651651 if (!(f = flux_job_event_watch (h , id , "guest.exec.eventlog" , 0 ))
652- || flux_future_then (f , 300 . , wait_for_shell_init , ctx ) < 0 )
652+ || flux_future_then (f , -1 . , wait_for_shell_init , ctx ) < 0 )
653653 shell_die (1 , "flux_job_event_watch" );
654654
655655 /* Return control to job shell */
@@ -672,7 +672,7 @@ static int sp_task (flux_plugin_t *p,
672672 flux_shell_t * shell ;
673673 flux_t * h ;
674674 int i ;
675-
675+
676676 debug_printf (1 , "In flux plugin sp_task\n" );
677677 struct spindle_ctx * ctx = flux_plugin_aux_get (p , "spindle" );
678678 if (!ctx || !spindle_is_enabled (ctx )) {
@@ -699,18 +699,18 @@ static int sp_task (flux_plugin_t *p,
699699 bootstrap_argc = ctx -> argc ;
700700 bootstrap_argv = ctx -> argv ;
701701 }
702-
702+
703703 /* Prepend spindle_argv to task cmd */
704704 for (i = bootstrap_argc - 1 ; i >= 0 ; i -- )
705705 flux_cmd_argv_insert (cmd , 0 , bootstrap_argv [i ]);
706-
706+
707707 char * s = flux_cmd_stringify (cmd );
708708 shell_trace ("running %s" , s );
709709 free (s );
710710
711711 if (session_mode )
712712 free_bootstrap_args (bootstrap_argc , bootstrap_argv );
713-
713+
714714 return 0 ;
715715}
716716
@@ -724,15 +724,15 @@ static int sp_exit (flux_plugin_t *p,
724724{
725725 flux_shell_t * shell = flux_plugin_get_shell (p );
726726 flux_t * h = flux_shell_get_flux (shell );
727-
727+
728728 debug_printf (1 , "In flux plugin sp_exit\n" );
729729 struct spindle_ctx * ctx = flux_plugin_aux_get (p , "spindle" );
730730 if (!spindle_is_enabled (ctx ))
731731 return 0 ;
732732 if (spindle_in_session_mode (h , NULL , NULL ) > 0 )
733733 return 0 ;
734734 if (ctx && ctx -> params .opts & OPT_OFF )
735- return 0 ;
735+ return 0 ;
736736 if (ctx && ctx -> shell_rank == 0 )
737737 spindleCloseFE (& ctx -> params );
738738 return 0 ;
0 commit comments