You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ serve -s .>/dev/null 2>&1&[1] 31586
# after a couple of seconds, this message is displayed:[1] + 31586 suspended (tty output) serve -s . > /dev/null 2>&1
# checking process status... output edited for readability
$ ps gv | grep serve32623 pts/28 TNl 0:00 0 24425 898230 42720 0.2 node <some_path>/serve -s .
# the "T"in"TNl" above means the process is "stopped, either by a job control signal or because it is being traced."
# for details, go to https://linux.die.net/man/1/ps and Ctrl-F "process state codes"
# at this point, opening the link in the browser produces no response (connection stalls)
# however, all of these combinations work just fine:
$ serve -s .&# neither stdout nor stderr redirected
$ serve -s .>/dev/null &# stderr not redirected
$ serve -s .2>/dev/null &# stdout not redirected
$ serve -s .1>/dev/null 2>&1# not backgrounded
As you can see, the issue only occurs if all 3 of the following conditions hold:
stdout is redirected (>/dev/null or 1>/dev/null)
stderr is redirected (2>/dev/null or, more commonly, 2>&1)
the process is sent to the background (trailing &)
The text was updated successfully, but these errors were encountered:
vickychijwani
changed the title
Serve process gets suspended when stdout and stderr are supressed and the process is daemonized
Process suspended when stdout and stderr are redirected and the process is daemonized
Apr 24, 2017
Updating the dependencies (npm install) should fix this but now although the process is not stopped immediately, it doesn't run the server (if you go to http://localhost:5000 it never loads)
Here's a shell session demonstrating the issue:
As you can see, the issue only occurs if all 3 of the following conditions hold:
>/dev/null
or1>/dev/null
)2>/dev/null
or, more commonly,2>&1
)&
)The text was updated successfully, but these errors were encountered: