From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost by hawkwind.utcs.toronto.edu with SMTP id <2734>; Mon, 25 Oct 1993 14:24:25 -0400 Return-Path: immd3.informatik.uni-erlangen.de!dalibor Received: from faui45.informatik.uni-erlangen.de ([131.188.1.45]) by hawkwind.utcs.toronto.edu with SMTP id <2726>; Fri, 15 Oct 1993 07:31:19 -0400 Received: from faui30.informatik.uni-erlangen.de by uni-erlangen.de with SMTP; id AA18816 (5.65c-5/7.3v-FAU); Fri, 15 Oct 1993 12:30:42 +0100 Received: from faui30a.informatik.uni-erlangen.de by immd3.informatik.uni-erlangen.de with SMTP; id AA03082 (5.65c-5/7.3v-FAU); Fri, 15 Oct 1993 12:30:38 +0100 From: Stefan Dalibor Message-Id: <199310151130.AA03082@faui30.informatik.uni-erlangen.de> Date: Fri, 15 Oct 1993 07:30:39 -0400 To: rc-owner Subject: Interrupts in backquotes Reply-To: Stefan.Dalibor@informatik.uni-erlangen.de Resent-To: rc Resent-Date: Mon, 25 Oct 1993 14:23:59 -0400 Resent-From: Chris Siebenmann Resent-Message-Id: <93Oct25.142425edt.2734@hawkwind.utcs.toronto.edu> Hi, I want to execute a command via rsh on several hosts in a script; some of the remote hosts are ill-behaving in a way that makes them answer ping-requests but hanging forever once the rsh-command is started :(. I tried to implement a timeout with a handler for SIGALRM - this handler is called, but then the script aborts with the error message backquote read: Interrupted system call What is the correct way to perform such actions? Or should there perhaps be special treatment for EINTR when occuring in bqinput() (as this is done in fdgchar())? Thanks, Stefan This is rc-1.4 on SunOS 4.1.3 (gcc) and IRIX 4.0.5H (cc), snippets from script: . . . . . . timeout=10 fn sigalrm { echo timeout timedout=yeah } for(hanghost in $hostlist) { if(/usr/etc/ping $hanghost 4 >/dev/null >[2=1]) { timedout=no {sleep $timeout; kill -ALRM $pid} & # timer started timerpid=$apid echo -n $hanghost^': ' res=`{rsh $hanghost '$HOME/bin/m88k/osv'; echo $status} if(~ $timedout no) { # rsh succeeded kill -INT $timerpid >[2]/dev/null . . . . . . } else # timer expired . . . . . . } echo Done Output from script: ; ./src/rc-1.4/rc-1.4-g bin/mstat m41: SYSV88 m42: SYSV88 m43: timeout backquote read: Interrupted system call