I'm trying to check if a scan of an Accumulo table times out (to see if the table is corrupted).


timeout -s KILL 20s accumulo shell -zi myInstance -u root -p secret -e "scan -np -t myTable"

if [ $? -eq 0 ]; then
  echo 'Scan successful'
  echo 'Scan timed out'

The script runs the full 20 seconds and doesn't execute the accumulo shell command, and also returns a 0 exit status incorrectly.

If I run the above timeout command in a terminal the command runs as expected. If I run a basic timeout command (e.g. timeout -s KILL 20s sleep 10) in the script or in a terminal, that works as well. So for some reason the combination of a timeout and accumulo shell command in a bash script does not work.

  • Accumulo version: 1.6.0-cdh4.6.0
  • OS version: CentOS 6.6
  • Does the shell command work without the timeout? Feb 4, 2016 at 15:21
  • Yes, the shell command works without the timeout in both the script and terminal.
    – Joe W
    Feb 4, 2016 at 19:10

1 Answer 1


I discovered the issue stems from running the command in a different shell. If I run the script using the source command, e.g. source myScript.sh, the script runs as expected.

However, I haven't yet been able to track down why running the combination of timeout and accummulo shell in a different shell doesn't work.

  • I wonder if this has something to do with the way the accumulo script calls exec to launch Java? Feb 4, 2016 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.