>I'm trying to rsh a script of the following kind:
>
>#!/usr/afsws/bin/pagsh
>/usr/local/staff/reauth 86400 afs_principal < password_file
>
>It works fine when executed on any particular host, but when rsh'ed,
>the pagsh goes 'defunct', thus hanging the rsh, until the reauth is
>killed.

Ummm, assuming that "reauth" is going to run for a long time, I would guess
that the problem is that stdin/stdout/stderr is still tied up by reauth, and
that rshd is waiting for those descriptors to close.

The fact that pagsh is in a defunct state is really a red herring in this
case.  It's going defunct because it's exited, but rshd doesn't clean up
the status until it gets a close.

What you probably want to do is something like this:

rsh foo my_script "<" /dev/null ">&" /dev/null

Or in your script:

#!/usr/afsws/bin/pagsh
exec < /dev/null > /dev/null 2>&1
[...]

--Ken

Reply via email to