Re: exit code: 141 causes Perl 6 to exit.
FWIW, 141 is SIGPIPE. (signal 13 + WIFSIGNALED flag (128)) So something's happening in your RUN script that's causing it to write to a closed pipe. I hope this helps! -Rob On Mon, 27 Mar 2017 11:51:03 +0300 Gabor Szabo wrote: > Putting > > CATCH { default { put .^name, ': ', .Str } }; > > in the While loop helped with the restarting, but I am still not sure > if this is the expected behavior or not. > > > run.pl: > > while True { > say "Starting"; > shell("perl6 a.pl"); >CATCH { default { put .^name, ': ', .Str } }; > } > > > a.pl: > > print "in a.pl\n"; > exit(141); >
Re: exit code: 141 causes Perl 6 to exit.
Putting CATCH { default { put .^name, ': ', .Str } }; in the While loop helped with the restarting, but I am still not sure if this is the expected behavior or not. run.pl: while True { say "Starting"; shell("perl6 a.pl"); CATCH { default { put .^name, ': ', .Str } }; } a.pl: print "in a.pl\n"; exit(141);
exit code: 141 causes Perl 6 to exit.
The lack of open filehandles seem to be fixed. The server now stays up for quite long time, but I've just seen the following on the command line: The spawned command './RUN' exited unsuccessfully (exit code: 141) in block at wrap.pl6 line 5 I'd like to understand what this exit code: 141 might be, but also I am surprised this stopped the server. After all I use this code to launch it: https://github.com/szabgab/Perl6-Maven/blob/main/wrap.pl6 and run "perl6 wrap.pl6" This should relaunch the server when it crashes, but it did not do it. The wrapper itself excited. Any idea what could be the source of exit code 141? How to run the external script so even if it exits my main code does not exit. (BTW using "run" instead of "shell" did not help either.) Gabor ps. The following two scripts can reproduce the issue with "shell": run.pl: while True { say "Starting"; shell("perl6 a.pl"); say "Ending"; } a.pl: print "in a.pl\n"; exit(141); $ perl6 run.pl Starting The spawned command 'perl6 a.pl' exited unsuccessfully (exit code: -1) in block at run.pl line 3 $