#!/bin/sh { ./time_consuming_binary -a param -a notherparam --pleaseblock } & CHILDPID=$! # Kill it after 30 sec sleep 30 kill -9 $CHILDPID 2>&1 /dev/nullHow 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.
According to The Directive 2009/24/EC of the European Parliament and of the Council, and Sec.103(f) of the DMCA (17 U.S.C. § 1201 (f)), the reverse engineering act committed to creating these blog posts is considered legal, as this is an original attempt to improve interoperability, and cannot be waived by license agreements.
The views expressed on this blog are my own and do not necessarily reflect the views of my past and present employers.
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:
Labels:
bash
,
concurrency
,
linux
,
nfs
,
parallel
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:
If you cannot start it, restart portmap first.
Your nfslock daemon is not running. Check for rpc.statd:
Bad: NFS Locking Daemon is NOT running |
Subscribe to:
Posts
(
Atom
)