exit-code

Spring batch return custom process exit code

限于喜欢 提交于 2019-12-06 11:03:16
I have one jar with several jobs, I want to execute only one job each time and retrieve a custom exit code. For example, I have basic job ( retrieveErrorsJob ) configuration with one step that will read an input XML file and write the data in specific database table. Application class @SpringBootApplication @EnableBatchProcessing @Import(CoreCommonsAppComponent.class) public class Application { private static final Logger logger = LoggerFactory.getLogger(Application.class); private ConfigurationConstants constants; @Autowired public Application(ConfigurationConstants constants) { this

Capturing exit status from STDIN in Perl

安稳与你 提交于 2019-12-06 09:43:43
I have a perl script that is run with a command like this: /path/to/binary/executable | /path/to/perl/script.pl The script does useful things to the output for the binary file, then exits once STDIN runs out (<> returns undef). This is all well and good, except if the binary exits with a non-zero code. From the script's POV, it thinks the script just ended cleanly, and so it cleans up, and exits, with a code of 0 . Is there a way for the perl script to see what the exit code was? Ideally, I'd want something like this to work: # close STDIN, and if there was an error, exit with that same error.

SpecRun returning exit code 120 with @ignore tests

女生的网名这么多〃 提交于 2019-12-06 08:58:55
Running SpecRun from command line as part of a Continuous Integration setup, and recently an ignored ( @ignore ) test generated an exit code of 120 when SpecRun completed. Currently, we break the build on any exit code not equal to 0 (universal success indicator!). What does exit code 120 mean exactly? Is it simply "A test was ignored"? or does it imply more? What other values are returned? Sample build output below. We collect all exit codes (currently 1 SpecRun task, so only 1 exit code is collected), and print out to "exit codes" 58> Done. 58> Result: all tests passed (5 ignored) 58> Total:

Powershell equivalent of Linux true command

浪子不回头ぞ 提交于 2019-12-06 04:58:14
This stackoverflow answer explains what the Linux true command is. My question, does Powershell (v5/v6) offers also a true command? I already googled around, used Get-help *true* , but could not find anything about it. Thx In short: There is no PowerShell equivalent to the true and false Unix utilities. Because PowerShell's conditionals and error handling work very differently than in POSIX-like shells such as bash , there is no need for them. The primary use of Unix utility true is to reset the exit code to 0 in situations where you deliberately want to ignore a previous command's failure

Auto exit Telnet command back to prompt without human intervention ^] quit close exit code 1

混江龙づ霸主 提交于 2019-12-06 03:46:14
I'm running telnet command on a host for a given port (which is open), it returns 0 (success). For trying telnet manually, I type the following command, then I press control+bracket i.e. ^] , then press Enter key, then I get to telnet> prompt, where if I type close or quit , it comes back to the $ prompt and seeing exit status of last command shows 0 for (success) as port 2878 is open (as per the telnet command's output). [vagrant@myvagrant /tmp] $ telnet `hostname` 2878 Trying 127.0.0.1... Connected to myvagrant. Escape character is '^]'. ^] telnet> close Connection closed. [vagrant@myvagrant

Predictable exit code of crashed process in Windows

青春壹個敷衍的年華 提交于 2019-12-06 03:12:51
问题 For a process exiting normally in Windows, the exit code of the process is generally either the return value from main , or the exit code passed to std::exit . %ERRORLEVEL% can then be used to query the exit code, and that can be used to determine whether the program executed either correctly, or there were some exceptional inputs/failures that indicate a particular problem (application specific). However, I'm interested in the exit code if the process crashes. Take a very simple example

Cannot launch shell script with arguments using Java ProcessBuilder

与世无争的帅哥 提交于 2019-12-05 22:29:39
I am trying to execute a shell script with command line arguments using ProcessBuilder, this shell script inturn calls two other shell scripts that uses this argument. The first shell script runs fine, but when the second one is started it returns exit code 1. ProcessBuilder snippet from Java Program: //scenario - A string that holds a numerical value like 1 or 2 etc String[] command2 = {"/bin/bash", "<path to shell script>/runTemporaryTestSuite.sh", scenario}; ProcessBuilder pb2 = new ProcessBuilder(command2); Process p2 = pb2.start(); BufferedReader br = new BufferedReader(new

My server exited with code 137

前提是你 提交于 2019-12-05 19:05:49
I wrote a C++ server/client pair using C++11, boost::asio and HDF5. The server was running fine for a some time (2 days), and then it stopped with code 137. Since I executed the server with an infinite loop, it was restarted. Unfortunately, my error logs don't provide sufficient information to understand the problem. So I've been trying to understand what this code means. It seems there's consensus that this means it's an error of 128+9 , with 9 meaning that the program was killed with kill -9 . Now I'm not sure at all why this happened. I need help to find out. By reading further, I found out

Pyside applications not closing properly

筅森魡賤 提交于 2019-12-05 18:26:55
I recently took up GUI programming in PySide and I'm having trouble with an oddity regarding exit commands. Sys.exit([x]) seems to be widely used to stop a PySide program; whenever I use it in a PySide program using classes, however, it doesn't return an exit code to PyCharm or stop the Python process in the task manager. Oddly enough it seems it's incredibly hard to do either of these things when using PySide; I could break out of the main loop, call sys.exit(0) , raise SystemExit(0) and it wouldn't stop running in the background. This only happens when using PySide, and only when using

Python thread exit code

青春壹個敷衍的年華 提交于 2019-12-05 14:54:41
问题 Is there a way to tell if a thread has exited normally or because of an exception? 回答1: As mentioned, a wrapper around the Thread class could catch that state. Here's an example. >>> from threading import Thread >>> class MyThread(Thread): def run(self): try: Thread.run(self) except Exception as err: self.err = err pass # or raise err else: self.err = None >>> mt = MyThread(target=divmod, args=(3, 2)) >>> mt.start() >>> mt.join() >>> mt.err >>> mt = MyThread(target=divmod, args=(3, 0)) >>> mt