Can you nohup a running process
Improve this answer. Community Bot 1. Andrew B Andrew B Looks like you are close: nohup sh custom-script. How this is going to convert my running process on the terminal into a nohup? You have to start the process this way. If you are asking how to make a pre-existing process go to nohup you want to use "disown", not sure if you can get the stdout redirected then though — TheFiddlerWins.
The question clearly asked about an already running process. I clearly didn't read it then. Try disown for already running processes — TheFiddlerWins. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. MarinosAn Yes, I did. Nothing happened, as expected. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.
The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Linked 4.
See more linked questions. Related Hot Network Questions. Question feed. Accept all cookies Customize settings. More information on how bash terminates applications can be found here.
There are cases where nohup does not work, for example when the process you start reconnects the SIGHUP signal, as it is the case here. Some shells e. In bash, this can be obtained by using disown -h job ; using the same builtin without arguments removes the job from the job table, which also implies that the job will not receive the signal.
Before using disown on an active job, it should be stopped by Ctrl-Z , and continued in the background by the bg command.
Unlike the above-described disown builtin of bash, nohup -p accepts process IDs. Note that nohupping backgrounded jobs is typically used to avoid terminating them when logging off from a remote SSH session. Among others, this depends on whether a pseudo-terminal was allocated or not. Your job numbers will most likely be 1 or 2 or 3 etc. An example:. Pro: Puts running process into background. Con: If you quit out of the shell window the process stops.
To place a foreground process in the background: suspend the foreground process with Ctrl-z then enter the bg command to move the process into the background. Show the status of all background and suspended jobs: jobs. Pro: Puts running process into background, and if you quit out of the shell it still runs. Using the Job Control of bash to send the process into the background:.
0コメント