1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
4
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=iso-8859-1">
6
<meta name="GENERATOR" content="Mozilla/4.76C-CCK-MCD Netscape [en] (X11; U; SunOS 5.8 sun4u) [Netscape]">
7
<meta name="AUTHOR" content="Joachim Gabler">
8
<meta name="CREATED" content="20010611;17143700">
9
<meta name="CHANGEDBY" content="Joachim Gabler">
10
<meta name="CHANGED" content="20010625;17001600">
15
<a NAME="qrsh_dokument"></a>QRSH- Queue Remote Shell</h1>
19
Qrsh starts a job similar to qsub, with the difference that
22
stdin/stdout/stderr is not redirected to a file but to the callers iostreams,
23
usually the current terminal</li>
26
it is possible to start binaries</li>
29
the returncode of the executed command is propagated to the caller by qrsh</li>
32
if no command is specified, an rlogin session is started</li>
35
if a special commandline option -inherit is specified, qrsh will start
36
a subtask in an existing Gridengine parallel job</li>
38
Qrsh uses the rsh/rshd mechanism (or any similar tool like ssh) to start
39
the remote process and redirect io.
40
<p>If nothing else is configured, qrsh will start
41
<tt>$SGE_ROOT/utilbin/$ARCH/rsh</tt>,
42
the rshd used is <tt>$SGE_ROOT/utilbin/$ARCH/rshd</tt>, which is a rshd
43
derived from NetBSD code extended by some code to allow process control
44
and collection of usage information (see also
45
<tt>3rdparty/remote</tt>).
46
<p>To configure the system rsh/rshd or an other mechanism the values <tt>rsh_client</tt>
47
and <tt>rsh_daemon</tt> resp. <tt>rlogin_client</tt> and <tt>rlogin_daemon</tt>
48
in the cluster configuration have to be set.
54
If a user submits a job with qrsh, the following actions are taken
57
The commandline is parsed and split into codine options and commandline
61
A job object is created</li>
64
The job is submitted (communicated to qmaster)</li>
67
qrsh waits for the job to be started; in regular intervals it requests
68
the job status from qmaster, to detect if the job has eventually been deleted</li>
71
qmaster sends order to start job to execd</li>
74
execd starts shepherd</li>
77
The corresponding shepherd contacts qrsh over a socket connection and passes
78
the execution host and the port on which a rshd will be started.</li>
81
qrsh forks and executes a rsh command that connects to the specified host
82
and port number on the execution host, then it waits for the command to
86
On the execution side, rshd will start a qrsh_starter command</li>
89
The qrsh_starter sets up the jobs environment, starts a users login shell
90
and executes the specified commandline</li>
93
After the command exits, the qrsh_starter writes the exit code of the command
94
to a file and exits, rshd exits</li>
97
The corresponding shepherd collects job information like usage and exit
98
code, it communicates the exitcode to qrsh</li>
101
qrsh exits with the exitcode of the command or an error, if an error in
102
the mechanism occurred.</li>
104
<img SRC="process_flow1.gif" NAME="Graphic1" BORDER=0 height=788 width=1121 align=TEXTTOP>
109
If a user submits a login session with qrsh (rlogin), the following actions
113
The commandline is parsed (codine options)</li>
116
A job object is created</li>
119
The job is submitted (communicated to qmaster)</li>
122
qrsh waits for the job to be started; in regular intervals it requests
123
the job status from qmaster, to detect if the job has eventually been deleted</li>
126
qmaster sends order to start job to execd</li>
129
execd starts shepherd</li>
132
the corresponding shepherd contacts qrsh over a socket connection and passes
133
the execution host and the port on which an rlogind will be started.</li>
136
Qrsh forks and executes an rlogin command that connects to the specified
137
host and port number on the execution host, then it waits for the command
141
On the execution side, rlogind will spawn a login which creates a login
145
After the login shell exits, rshd exits</li>
148
The corresponding shepherd collects job information like the usage and
149
will communicate the job end to qrsh</li>
152
qrsh exits with the exitcode 0 or an error, if an error in the mechanism
155
<img SRC="process_flow2.gif" NAME="Graphic2" BORDER=0 height=788 width=1121 align=TEXTTOP>
162
Process hierarchie</h1>
166
Qrsh forks a rsh or an rlogin command, if rsh shall handle stdin (no -nostdin
167
option to qrsh), it forks another child process that handles stdin.
168
<p>Qrsh -> rsh -> rsh
175
In the standard case, the command will be executed in a users login shell:
176
<p>execd -> shepherd -> rshd -> qrsh_starter -> loginshell -> command
178
without login shell</h3>
179
If the option -noshell is passed to qrsh, the command will be executed
180
directly without a wrapping login shell.
181
<p>Execd -> shepherd -> rshd -> qrsh_starter -> command
183
with wrapper script</h3>
184
A wrapper script can be specified, that for example sets up a special environment,
185
e.g. A clearcase view.
186
<p>A wrapper script is defined in the environment variable QRSH_WRAPPER.
187
<p>Execd -> shepherd -> rshd -> qrsh_starter -> wrapper -> command
190
Execd -> shepherd -> rlogind -> login shell
195
<p>Copyright 2001 Sun Microsystems, Inc. All rights reserved.</center>