fhg
Volume 6, Number 24 -- June 21, 2006

Autostarting WAS 6.0 on the System i

Published: June 21, 2006

Hey, Brian:

I just read your article on WebSphere Application Server 6.0; thank you for the info. The question I have is this: I cannot find any examples on how to start a WAS 6.0 instance from QSTRUP. QEJBSTRSVR does not exist for WAS 6.0 and I am unsure of the QShell command to perform the function. How can I autostart WAS 6.0? Any help would be greatly appreciated.

Thanks.

--Alan


Glad you enjoyed the article.

Let me first show you the way around the WAS 6 directory structure. When you have a chance, get a command line and go out to the bin directory in the WAS 6 production area of the IFS. Use WRKLNK to get you at the root of the IFS and then keep taking option 5 from QIBM down and walk your way to the bin directory. Start with WRKLNK and you will see the following:

                            Work with Object Links                            
                                                                              
Directory  . . . . :                                                          
                                                                              
Type options, press Enter.                                           
  2=Edit   3=Copy   4=Remove   5=Display   7=Rename   8=Display attributes    
  11=Change current directory ...                                    
                                                                              
Opt   Object link            Type     Attribute    Text                       
 5     /                      DIR                                              
                                                                              
                                             Bottom
Parameters or command                                                         
===>                                                                          
F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F12=Cancel   F17=Position to 
F22=Display entire field           F23=More options                           

Keep taking option 5 on each of the following directories in the path (one after the other) and you will be in the bin directory.

/QIBM/ProdData/Websphere/appserver/v6/Base/bin

You will see a host of commands that are used by ADMIN GUI and that you can use with QSH. If you roll a few times, you will get to the start and stop commands. The panel will look like this:

                            Work with Object Links                            
                                                                              
Directory  . . . . :   /QIBM/ProdData/WebSphere/AppServer/V6/Base/bin         
                                                                              
Type options, press Enter.                                           
  2=Edit   3=Copy   4=Remove   5=Display   7=Rename   8=Display attributes    
  11=Change current directory ...                                    
                                                                              
Opt   Object link            Type     Attribute    Text                       
      setupClient            STMF                                             
      setupCmdLine           STMF                                             
      showlog                STMF                                             
      sibDDLGenerator        STMF                                             
      startNode              STMF                                             
      startServer            STMF                                             
      stopNode               STMF                                             
      stopServer             STMF                                             
      svrsslcfg              STMF                                             
 			                         More...
Parameters or command                                                         
===>                                                                          
F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F12=Cancel   F17=Position to 
F22=Display entire field           F23=More options                           

Now that we know what we are looking for, let's find it using QSH (Qshell). Start by typing on a command line the following:

QSH

This gives you the rather stoical-looking Qshell command interface for running Unix commands on your System i5. It is shown below:

                               QSH Command Entry                                
                                                                                
   $                                                                            
                                                                                
                                                                                
 ===> _______________________________________________________
_____________________________________________________________ 
F3=Exit   F6=Print F9=Retrieve F12=Disconnect                                  
 F13=Clear F17=Top  F18=Bottom  F21=CL command entry                            

Let's traverse the directories as we did with WRKLNK but this time, let's type in the full path to get to bin. We could have done this with WRKLNK also. Even before this, let's position ourselves at the root directory by issuing the following command in QSH.

cd /

It looks like the OS/400 command line change directory and it is similar to the Windows cd command. It does the same thing. After executing the command, you are at the root directory of your System i5. In Qshell, you may notice that capitals such as CD do not work so it is case sensitive.

The Unix equivalent of the Directory command is the list directory command and it is abbreviated as ls. That's an "L" and an "S." So, let's do that next:

ls

Qshell will quickly bring back to you the contents of the root directory, which will be something like the following.

                               QSH Command Entry
                                                
 INBOX                   linoma                
 INCOMING                matt                  
 INTERNAL                msg                   
 InstallShield           myfile.txt            
 MCtips                  newtcp                
 MONTHLYJOB              qrpglesrc.sndemailr   
 QDLS                    qslibcbl.sav          
 QFileSvr.400            tmp                   
 QIBM                    usr                   
 QNTC                    var                   
 QOPT                    www                   
 QOpenSys                                      
 QSR                                           
                                                                                
 ===> _________________________________________________
_______________________________________________________
                                                       
 F3=Exit   F6=Print F9=Retrieve F12=Disconnect         
 F13=Clear F17=Top  F18=Bottom  F21=CL command entry   
 

Yours will not be exactly like this because this snapshot was from a machine that had already used the root to hold other directories. Yet QIBM, the directory in which IBM stores its product information, is certainly in the list.

Now, let's go directly to the bin directory with one cd command.

cd /QIBM/ProdData/Websphere/appserver/v6/Base/bin

Once in the bin directory, let's see what is there by asking Qshell to list the directory.

ls

The first page of the directory looks as follows with a QSH view:

                              QSH Command Entry    
                                                   
  uddiDeploy.jacl                                  
  uddiRemove.jacl                                  
  uninstall                                        
  uninstallSdoRepository.jacl                      
  updwashost                                       
  verifyinstallver                                 
  versionInfo                                      
  wasprofile                                       
  wrd                                              
  wrd-config                                       
  ws_ant                                           
  wsadmin                                          
  wsdeploy                                         
  $                                                
                                                   
===>                                               
                                                   
F3=Exit   F6=Print F9=Retrieve F12=Disconnect
F13=Clear F17=Top  F18=Bottom  F21=CL command entry

Unlike WRKLNK, which shows you the first page and then lets you page forward, the LS in Qshell shows you the last items of the directory and permits you to scroll back to see the prior panels.

Roll back one page and you will find the start commands that we saw with Qshell:

                               QSH Command Entry
                                                
   securityProcs.jacl                           
   securityProcs.py                             
   serverStatus                                 
   servicetools                                 
   setupClient                                  
   setupCmdLine                                 
   showlog                                      
   sibDDLGenerator                              
   startNode                                    
   startServer                                  
   stopNode                                     
   stopServer                                   
   svrsslcfg                                    
   syncNode                                     
                                                
 ===>                                           
                                                
F3=Exit   F6=Print F9=Retrieve F12=Disconnect   
 F13=Clear F17=Top  F18=Bottom  F21=CL command entry 

Of course when in Qshell, you could have walked through the directories as with WRKLNK by executing the following:

CD QIBM
CD ProdData
etc.

At each level, you can do a Unix list command ls to get a directory list at that level from Qshell. The list should mirror what you experienced with WRKLNK. When you get to the directory you want you can interactively issue the startServer or stopServer commands as shown below to get your WAS going from the green screen Qshell interface.

startServer -profileName MyWASProfile

Since WAS "instances" and "servers" are known as profiles in WAS 6.X if you have created a profile named MyWASProfile, it will start from QSHELL interactively by executing the above from the bin directory.

You can also execute this command in batch or in CL programs.

To execute QSH in batch, you can use the following as a GUIDE:

SBMJOB CMD(QSH CMD('cd /QIBM/ProdData/WebSphere/AppServer/V6/Base/bin;
startServer -profileName MyWASProfile')) JOBQ(QSYS/QSYSNOMAX)

The above submits two QSHELL commands separated by a semicolon. The OS/400 command QSH is submitted and Qshell is started. The first thing Qshell sees is the cd command so it changes to the bin directory. Then it sees the command separator (semicolon) and then it sees the startServer command and it finds the command in the bin directory and executes it. We pass one parameter to the command with the "-profileName" parameter keyword followed by the name of the profile we want to start.

To create an autostart job entry, perform the following:

  1. Create a CL program called STARTWAS6 and place it in QGPL (or your favorite library). Take the command above and place it in the CL program sandwiched by a PGM statement and an ENDPGM statement. Compile the program to QGPL or your favorite library.
  2. Create a job description called AUTOWAS6 for the autostart job. Run CRTDUPOBJ against the QDFTJOBD job description and name it AUTOWAS6 and store it in QGPL or your favorite library.
  3. Change the jobq and the request data in the job description to run the STARTWAS6 program from the jobq of your choice. Make sure the job queue is associated with a subsystem that is started. Check out your system to find the controlling subsystem (QCTLSBDS), which will always be up when you power up your system.
  4. Add the autostart job entry to a subsystem, such as the controlling subsystem, that is sure to be up each time you IPL.

The commands to do steps two to four are shown below:

CRTDUPOBJ OBJ(QDFTJOBD) FROMLIB(*LIBL) OBJTYPE(*JOBD) TOLIB(QGPL) NEWOBJ(AUTOWAS6)

The reply will be: Object AUTOWAS6 in QGPL type *JOBD created.

Then modify the Job description as follows:

CHGJOBD JOBD(QGPL/AUTOWAS6) JOBQ(QCTL) TEXT('Auto Start WAS 6 Job Description') RQSDTA('CALL QGPL/STARTWAS6')

The reply will be:
Job queue QCTL found in library QSYS.
Job description AUTOWAS6 in library QGPL changed.

Now that you have a job description with request data (the call of STARTWAS6 CL program from QGPL) built right into it, you need to find a subsystem that will be always brought up in your installation. In the above example, I used the job queue QCTL so this would run in the QWCTL subsystem at startup. I could have used QINTER or a user subsystem that is surely going to be started each IPL. If you are in S/36 environment, perhaps you are using the QBASE subsystem rather than WCTLL as your controlling subsystem. You can check this out with the following command:

WRKSYSVAL QCTLSBSD

Then take option 5 to see the value. In my case, the panel looked as follows:

                              Display System Value
                                                  
 System value . . . . . :   QCTLSBSD              
 Description  . . . . . :   Controlling subsystem 
                                                  
                                                  
 Controlling subsystem  . . . :   QCTL            
   Library  . . . . . . . . . :     QSYS          
                                                  
                                                  
 Press Enter to continue.                         
                                                  
 F3=Exit   F12=Cancel                             

As you can see, the controlling subsystem in this case is QCTL. If it is QBASE or something else, you can replace QCTL with the proper name in the job description above. This startup code does not have to execute in the controlling subsystem but the subsystem to which it is directed must be operational and started for the WAS 6.X to autostart.

The AutoStart Job Entry

For this example, we will add the autostart job entry to the QCTL (controlling subsystem). First, let's look at the subsystem to see if there are already any autostart job entries there. To do this, first execute the following command to display the subsystem QCTL.

DSPSBSD QCTL

Take option 3 to display existing autostart job entries. You will see a panel such as the following:

                         Display Autostart Job Entries                        
			System:   SXXXXXX
 Subsystem description:   QCTL           Status:   ACTIVE                       
                                                                                
 Job            Job Description     Library          
 QSTRUPJD         QSTRUPJD          QSYS             
                                                     
                                                     Bottom 
 Press Enter to continue.                            
                                                     
 F3=Exit   F12=Cancel                                

As you can see there already is an entry on our system called QSTRUPJD. It uses job description QSTRUPJD in library QSYS. If you put on your Sherlock Holmes hat, you will find that there is a CL program called QSTRUP that originally comes from IBM and is stored in QSYS. This is the program that gets called by this autostart job entry.

To add the AUTOWAS6 job description as an autostart job entry in QCTL, perform the following:

ADDAJE SBSD(QCTL) JOB(AUTOWAS6) JOBD(QGPL/AUTOWAS6)

The reply will be: Change effective next time subsystem starts.

The next time the subsystem starts may be after an option 21 save or after a power down and power up sequence. Either way, this function will automatically start your WAS 6.0. The display of the autostart entries for QCTL after adding the AUTOWAS entry as follows:

                         Display Autostart Job Entries
            System:   S105PV4M 
 Subsystem description:   QCTL           Status:   ACTIVE                       
                                                                                
 Job            Job Description     Library          
 AUTOWAS6         AUTOWAS6          QGPL             
 QSTRUPJD         QSTRUPJD          QSYS             
                                                     
                                  Bottom 
 Press Enter to continue.                            
                                                     
 F3=Exit   F12=Cancel                                

The next thing you are probably going to want to do is start your profiles and or instances automatically. We'll show you how to do that another day.

Another Route to Autostart

If you are already using the QSTRUPJ program to start some things for you when the system comes up, then you may prefer to add the CALL to QGPL/ STARTWAS6 from this program. Either way, this is a handy tool to know to be able to get jobs from Qshell or from anywhere automatically started on your system.

What We Learned

So, we learned that to stop and start the WAS instance (now called a "profile" at 6.0), you can use these commands from QSH:

/QIBM/ProdData/Websphere/appserver/v6/Base/bin/stopServer -proflieName <profile> /QIBM/ProdData/Websphere/appserver/v6/Base/bin/startServer -profileName <profile>

And, we can submit these jobs and add the submits to CL programs. The programs can then become part of an autostart job experience or can be plugged right the System i5 startup program QSTRUP.

I sure hope this helps get you well on your way.

All the best.

--Brian


RELATED STORIES

Installing WebSphere and the Update Installer

Installing WebSphere Application Server 6.0



Sponsored By
WORKSRIGHT SOFTWARE

Do you need area code information?
Do you need ZIP Code information?
Do you need ZIP+4 information?
Do you need city name information?
Do you need county information?
Do you need a nearest dealer locator system?

We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

Just call us and we'll arrange for 30 days FREE use of either
ZIP/CITY or PER/ZIP4.

WorksRight Software, Inc.
Phone: 601-856-8337
Fax: 601-856-9432
E-mail: software@worksright.com
Web site: www.worksright.com



Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

iTera:  High availability solution for $50 a day - includes IBM System i5 Hardware
COMMON:  Join us at the Fall 2006 conference, September 17-21, in Miami Beach, Florida
LANSA:  An entirely different approach to application modernization and innovation

 


 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement