question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Java processes forked from Powershell will die when CTRL+C is used or when Powershell terminal window is closed.

See original GitHub issue

Steps to reproduce

Open a powershell terminal in Linux. You can use any gnome-terminal or terminator, doesn’t seem to matter what Terminal program you are using.

Run a program that runs a Jetty service in the background. Example: Lucidworks Fusion 4.2.6

/home/ndipiazza/.fusion/4.2.6/bin/fusion start

Now close the terminal.

Notice the Java binaries that were opened will killed when the powershell terminal dies.

Repeating these same steps using a normal terminal will not have this problem. It is only when you start the program from a powershell terminal that this happens.

video capture here: https://www.youtube.com/watch?v=MniUDVmiJGo&feature=youtu.be

This also does not happen on Windows.

Expected behavior

Should keep running after terminal is closed.

Actual behavior

Forked java processes die along with powershell. Seem to also die intermittently when you use “CTRL+C”.

Environment data


Name                           Value
----                           -----
PSVersion                      7.0.2
PSEdition                      Core
GitCommitId                    7.0.2
OS                             Linux 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mklement0commented, Nov 6, 2020

@vmiheer, I’ve posted an answer to your SO question, but the same information can be found in #12090.

Again, if there’s a desire to bring nohup functionality more directly to PowerShell, I suggest creating a new feature request.

0reactions
vmiheercommented, Nov 6, 2020

This is related: https://stackoverflow.com/questions/64707869/what-is-the-equivalent-of-nohup-in-linux-powershell I was asking explicitly how to do Start-Job which is equivalent to nohup.

<div>Stack Overflow</div><div>What is the equivalent of 'nohup' in linux PowerShell?</div><div>I very well know existence of duplicate question. But that question is marked answered and I don't think it at all answers the original question. The $ nohup command keeps executing command even if...</div>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Process running from Windows Powershell ...
If you start the process with Runtime.exec(..), it is sometimes necessary to read Bytes from the Process.getInputStream() resp. Process.
Read more >
Powershell process is Killed when CTRL-C from Script or ...
Does this happen with a freshly install version of windows? What happens when you run just powershell from Run?
Read more >
Program launched with start-process closing when script is ...
So I have a few programs I am trying to launch and keep running but, they are preventing the script from completing.
Read more >
Wait-Process (Microsoft.PowerShell.Management)
The Wait-Process cmdlet waits for one or more running processes to be stopped before accepting input. In the PowerShell console, this cmdlet suppresses...
Read more >
Close specific java process/application with PowerShell
In this article, we will have a look at a PowerShell script which achieves the same goal as the VBScript. With PowerShell it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found