Showing posts with label nfs. Show all posts
Showing posts with label nfs. Show all posts

2016-02-19

bash: homemade timeout replacement

So I was young and reckless, and didn't know there is a command called timeout in coreutils. This is how I managed to do it:
#!/bin/sh
{
    ./time_consuming_binary -a param -a notherparam --pleaseblock
} &
CHILDPID=$!
# Kill it after 30 sec
sleep 30
kill -9 $CHILDPID 2>&1 /dev/null
How to check if it had to be killed or not? Measure the wall time of the execution :) I've used it in a Nagios service check, the thing it watched either returned under 5 sec or blocked indefinitely (thanks, NFS), hence the 30 secs.

2013-10-30

tryLock and NFS --> weird failure, lockfile created but IOException returned

Using tryLock() on a FileChannel, and you cannot get a lock, BUT the lockfile itself is created?

Your nfslock daemon is not running. Check for rpc.statd:
Bad: NFS Locking Daemon is NOT running
If you cannot start it, restart portmap first.