A problem that I'd long since given up trying to fix a while back: Trying to launch a long running ant command in the background. For various reasons, I use ant to launch several long-running tasks (4+ hours). Most of the time, I want these tasks to run in the background. But pressing Ctrl-Z or appending the ampersand character ('&') to the end of the command would result in the process going into the stopped or suspended state on most Linuxes:
> ant run.fetch &
Job 1, 'ant run.fetch ' has stopped
After looking around a bit, and a bit of strace running, I discovered that the ant wrapper script really does not like being disconnected from standard-in, -out, and -error. So instead try redirecting all three:
> nohup ant run.fetch </dev/null 1>/tmp/stdout.log 2>/tmp/stderr.log &
This did the trick - allowing the ant command and subsequent java sub-processes to run unhindered in the background.
Hope this helps.