I want valgrind to stop on the first error it finds and exit.
Please do not suggest
--vgdb-error=1: It does not exit valgrind. You have to connect gdb and kill from there.
--db-attach: Deprecated and removed in a recent release
--log-file=<filename>: It does not stop valgrind.
My intention is to save my time and get my shell back as soon as the first error is printed. The first error is all I care about.
--gen-suppressions=yes will pause on each error and ask you if you wish to continue.
In addition to that, you can specify --input-fd=<file descriptor> to provide an alternative to stdin (standard input) at the moment of interacting with the suppression menu.
Related
What would cause std::process:Command::output to fail? If the callee program fails, the error will be captured as part of the resulting Output.stderr, so I guess output will only return an Error if the OS fails to create a new process for some reason? Is that something that I can safely ignore for my simple CLI tool?
There could be some issue opening the binary being executed (i.e. access denied, doesn't exist)
When waiting for the process to finish, the waitpid syscall could be interrupted
Getting the output involves creating a pipe, which will fail if the file descriptor limit is hit (cat /proc/sys/fs/file-max to check)
It also involves opening a file, which will fail if the limit on open files is reached (ulimit -n to check)
You probably only need to worry about the first two: you can't do anything about hitting limits in the kernel.
Is it possible to start a specific command of a Spring-Shell app and then return/exit the shell after the command is finished? Further is it possible to expose the exit code (System.exit) of the app to the operating system shell?
For my purpose i will take advantage of the plugin mechanism and the CLI-Annotations of Spring-Shell. But in general there is no human interaction with the app, instead a job scheduler (UC4) will start the app and check the exit code to generate an email in case of an exit code not equal to 0. On the other hand for manual tests by our customer, there is also the need of tab completion, usage help etc.
This behavior is already built-in (although we considered removing it, or at least make it optional). I see now that it is useful :)
Simply invoke the shell with your (sole) command and the shell will spin up, execute the command, and quit. Also, the return code of the shell already indicates whether there was an error or not (tried with an inexistant command for example). Of course, if your custom commands do not properly indicate an error (i.e. print an error message but perform a normal return) this will not work. You should throw an exception instead.
The behavior is back.
Run spring-shell with #my-script, like so:
java -jar my-app.jar #my-script
Where my-script is a file with your commands:
my-command1 arg1 arg2
my-command2 arg1 arg2
I have been researching for an answer for my question for a long while using Google and changing what words I use in-case I find my answer, I have had no luck.
What I want is to the read the output from a process in real-time, not when it finishes the command it has been given. I have a command that I use which doesn't end unless the user ends it manually, closes the form or an error occurs. So every timer interval I would like to read the output from the command prompt (process).
I use background workers to start the process so it doesn't interfere with the form if that is any help.
Thanks in advance.
In Pig Grunt, if I make a mistake in my command (for instance not closing a '), it shows a new prompt until the command is fixed:
grunt> tmp = LOAD '/mapred/data;
>>
In the case above, adding '; would solve it, but sometimes the command is long and complex, and finding the culprit proves difficult.
Is there a way to cancel the current entry without exiting Pig altogether? I.e., not ctrl+C or ctrl+D?
Note: I know it's similar to this question how to cancel command in GRUNT shell, but in my case the command hasn't been launched yet.
Corresponding to your example, I realized one way of exiting is to complete the line which is open due to the single quote. Therefore in this case I added the following in the next line and it quit with an error.
>> ';
Not sure if there is an easier way to do this, more so because the grunt shell is still not very developed. In any case, I hope there is a better workaround for this soon.
i have one exe,when this exe is called ,some this is exe is already open in task manager,i want kill all previous exe not current exe,i am using VB.net
As previous commenters have noted, you really should make more of an effort to solve the problem yourself (and demonstrate you've tried already)
Saying that, here are a few hints:
taskkill.exe /F /IM myprocess.exe /FI "PID ne 555"
Process.GetProcessesByName
Process.GetCurrentProcess
Process.Kill
Be very careful killing processes. As Anton Kovalenko noted already, are you really sure you want to do it? It may be better to simply warn of the condition and provide instruction to the user/admin.
Set your program up to receive messaging. When the most current instance launches have it send a message to the previous instance to itself shutdown gracefully - and of course put the code in place to do this.