Autostarting WAS 6.0 on the System i
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 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; 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:
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: 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> 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 |