hatools provide locking and timeout mechanisms for shell scripts.
