Support Questions
Find answers, ask questions, and share your expertise

Re: Running a Sqoop script in the background appears to 'hang' but works when running in the foreground

Explorer

@Alex Miller I was able to reproduce and personally had luck with screen as well as placing the "&" inside my test script itself at the end of the sqoop command rather than trying to background the script at invocation time (i.e. ./sqoop.sh &).

The /dev/null thing was also successful for me as well with Accumulo in place.

The customer apparently had gone ahead and removed the Accumulo bits before they had a chance to test my suggestions since any further they weren't using it, anyway.

So I really think there isn't a bug and we are hitting some bash-isms here more than anything else.

Thanks, all, for the tips.

View solution in original post

Re: Running a Sqoop script in the background appears to 'hang' but works when running in the foreground

@Kent Baxley Thanks for sharing this.

Re: Running a Sqoop script in the background appears to 'hang' but works when running in the foreground

Explorer

I too had this problem. My bash script worked fine in my DEV environment as a background job and as a foreground job. However, in my TEST environment the job would only run as a foreground job. In TEST, running as a nohup job would seem to stop at the point where my Sqoop step was called. Ultimately I came across this thread which pointed me in the right direction. Essentially you can emulate nohup by "daemonizing" your script.

setsid ./sqoop.sh </dev/null &>myLog.out &

Re: Running a Sqoop script in the background appears to 'hang' but works when running in the foreground

@Kent Baxley

Check what is the $PATH variable used in the script and in the CMD line. try adding the PATH to the script to be same as you run in the cmdline.