rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Interrupts in backquotes
@ 1993-10-15 11:30 Stefan Dalibor
  0 siblings, 0 replies; only message in thread
From: Stefan Dalibor @ 1993-10-15 11:30 UTC (permalink / raw)
  To: rc-owner


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-10-25 18:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-10-15 11:30 Interrupts in backquotes Stefan Dalibor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).