Run command in background does not work
My aim is to start docker in background. Due to some issues with services, I want to start docker manually in background.
Here my approach, where I run the docker daemon in background, so I don’t have the output on the command line and the command line is not blocked by the process.
HTTP_PROXY=http://example.net:8080 HTTPS_PROXY=http://example.net:8080 docker -d > docker.log &
But my approach does not work. The output is displayed on the command line and the command line is blocked by the process. Any ideas? Thank you.
One Solution collect form web for “Run command in background does not work”
You need to redirect standard error as well. On my machine, this worked for me and was silently running in the background…
sudo docker -d 2> docker.err.log > docker.log &
Edit: And yes, as that_other_guy correctly pointed out, if you don’t redirect stderr and put it in the background with
&, (as you have) the console output just makes it look like its still running in the foreground.