Download LCG-2 USER GUIDE
Transcript
As the command in this case opens an X window, the user should make sure the DISPLAY environment
variable is correctly set, an X server is running on the local machine and, if she/he is connected to the UI
node from a remote machine (e.g. with ssh), secure X11 tunneling is enabled. If this is not possible, the
user can specify the - -nogui option, which makes the command provide a simple standard non-graphical
interaction with the running job.
Example 5.1.4.1
(Simple interactive job)
The following interactive.jdl file contains the description of a very simple interactive job. Please
note that the OutputSandbox is not necessary, since the output will be sent to the interactive window (it
could be used for further output, though).
[
JobType = "Interactive" ;
Executable = "interactive.sh" ;
InputSandbox = {"interactive.sh"} ;
]
The executable specified in this JDL is the interactive.sh script, which follows:
#!/bin/sh
echo "Welcome!"
echo -n "Please tell me your name: "
read name
echo "That is all, $name."
echo "Bye bye."
exit 0
The interactive.sh script just presents a welcome message to the user, and then asks and waits for
an input. After the user has entered a name, this is shown back just to check that the input was received
correctly. Figure 7 shows the result of the program (after the user has entered his name) in the generated
X window.
Another option that is reserved for interactive jobs is - -nolisten: it makes the command forward the
job standard streams coming from the WN to named pipes on the UI machine, whose names are returned
to the user together with the OS id of the listener process. This allows the user to interact with the job
through her/his own tools. It is important to note that when this option is specified, the UI has no more
control over the launched listener process that has hence to be killed by the user (through the returned
process id) when the job is finished.
Example 5.1.4.2
(Interacting with the job through a bash script)
A simple script (dialog.sh) to interact with the job is presented in this section. It is assumed that the
CERN-LCG-GDEIS-454439
LCG-2 User Guide
Page 51