152 Geac System21 commerce.connect: Implementation on the iSeries Server
The following Qshell command runs the script myscript.sh and sends both standard output
and standard error to the file myscript.out:
myscript.sh > redirect.out 2>&1
If the file used for redirection already exists, then it is overwritten. If you want to append to the
file rather than to overwrite it, use >> or 2>>. The following command is similar to the previous
example, but appends the output to the file:
myscript.sh >> redirect.out 2>&1
If you want to run this script from a CL program or an OS/400 command line, then you can
use the following command:
QSH CMD(‘/mydirectory/myscript.sh >> redirect.out 2>&1’)
The script is qualified since it is usually easier in this context to do so rather than to set the
current directory. An alternative is to use:
QSH CMD(‘cd /mydirectory ; myscript.sh >> redirect.out 2>&1’)
This uses the QSH ability to take multiple commands separated by semi-colon (;). The output
of cd is not redirected in this example. The redirection only refers to the second command.
Redirection can be added to the cd command, but it does not produce standard output and
only produces error output if the directory is invalid (for example, does not exist, no authority
etc.).
6.3 Checking the QEJBSBS subsystem
WebSphere 3.5 jobs run in the QEJBSBS subsystem. You can use the WRKACTJOB
command to view this subsystem as shown here:
WRKACTJOB SBS(QEJBSBS)
On the Work with Active Jobs display (Figure 6-5), for each WebSphere instance, there is a
monitor and an administration job. There is one job for each application server that is stated in
the instance. There may be further jobs that are not part of WebSphere but that are closely
related to the application.
For the standard instance, the monitor job is called QEJBMNTR. It is the first job to start when
the subsystem is started. The administration job is called QEJBADMIN. It is started by
QEJBMNTR just after QEJBMNTR starts.
For any additional instances, there is another monitor and administration job. The names of
these jobs depend on how the instance was created, but it is common to use a short name for
the instance. An example is TEST followed by MNTR and ADMIN.
This example shows the standard instance and an additional instance called TEST running.
Two applications are also running.