Installation
Download the HFS executable: setstack
You will need to rename it to setstack.
After storing it in the HFS, run the following command to set the permissions:
chmod 755 setstack
If you want to run it from TSO or batch without using BPXBATCH, use the cploadmod utility to copy it to a library in your STEPLIB or link list. cploadmod is available from the Tools and Toys page.
The following command will put it in USER.LINKLIB:
cploadmod setstack 'user.linklib'
Examples
Waiting for a TCP/IP stack to become active
In some cases, it may be desirable to start a TCP/IP application, but to first wait until a TCP/IP stack is active. Some applications may not initialize properly if TCP/IP is not yet active. setstack may be used to only run the application once TCP/IP becomes active.
The following command will wait for a TCP/IP stack to become active before running server. Command-line arguments "1 1" will be passed to server.
setstack -w server 1 1
If server cannot be found via PATH, messages like the following will be displayed:
[MVS165:/u/user1/trawick/ss]$ setstack -w server
server: FSUM7351 not found
exit status: 127
Limiting a program's access to a single stack
The following command will wait for stack TCPCS to become active, then will run hostname. hostname will only have access to stack TCPCS.
setstack -w -a tcpcs hostname -g
Running an HFS executable from JCL
Here is JCL to start an HFS executable via setstack. Since the executable to be run by setstack is in the HFS, setstack must be run via BPXBATCH.
INETDPROCINETDEXECPGM=BPXBATCH,REGION=0M,TIME=NOLIMIT,
PARM='PGM /u/user1/trawick/setstack -w -a tcpcs /usr/sbin/inetd'
In this example, /usr/sbin/inetd is the program to be started by setstack and TCPCS is the name of the TCP/IP stack which inetd should be limited to. inetd will not be executed until stack TCPCS is active.
Feedback
Send your comments and other feedback to trawick@us.ibm.com.
|