RS60000 PCSIM AUTOMATED METHOD TO SHUTDOWN THIS APPLICAT ION...

ITEM: RTA000027899



                                                                                
                                                                                
                                                                                
******************************************************************              
******************************************************************              
                                                                                
QUESTION:                                                                       
The customer starts pcsim via cron but can not stop pcsim thru any              
automated method that he has tried. I assume this can be done, can              
you provide any insight and/or directions to accomplish the pcsim               
shutdown....                                                                    
                                                                                
ANSWER:                                                                        
A: Here are two ways you can do it:                                             
   1) Entirely from cron:                                                       
      In your cron pcsim startup script, use the following two lines:           
      pcsim &            # along with any options you want.                     
      echo $$ > /tmp/pcsim.pid                                                  
                                                                                
      In your cron pcsim shutdown script, use the following line:               
      kill -9 `cat /tmp/pcsim.pid`   # the ` is a back-tic.                     
                                                                                
      This procedure will save the PID of the pcsim session in                  
      /tmp/pcsim.pid, and use that process ID when it comes time to kill        
      pcsim.                                                                    
                                                                                
   2) Start pcsim through AIX (cron), stop pcsim through DOS.                  
      There is a HOWTO item, #9VPBP, that describes how to terminate            
      pcsim from a DOS batch file or a DOS program.  This method will           
      fail in AIX 3.2, because the ability to pass AIX commands through         
      the queuing system no longer works.  There is an APAR on that,            
      IX30832, that will fix the problem.  You may call IBM Software            
      Services at 1-800-237-5511 and request fix U410705, which fixes           
      that problem.  This method is not "automatic", like cron, but I am        
      including this information anyway since I am unclear as to why you        
      want to stop pcsim automatically.                                         
      I have included the text of HOWTO item 9VPBP below.                       
                                                                                
 Abstract: HOWTO AIX: TERMINATE PCSIM FROM A DOS BATCH FILE OR A                
           DOS PROGRAM                                                          
PLATFORM: RISCSYSTEM                                                           
*********************************************************************           
** This item contains information that is intended to be helpful,  **           
** accurate and act as a guide of HOW TO accomplish a given system **           
** task.  The provided explanations, techniques and procedures     **           
** have been reviewed for technical accuracy and applicability,    **           
** but have not been tested in every possible environment or       **           
** situation. Normal precautions should be taken in adopting these **           
** same techniques and procedures, because as product and system   **           
** interfaces change, so would the usage of this information       **           
** change.                                                         **           
*********************************************************************           
SCENARIO/EXPLANATION:                                                           
Outlined below is a method to terminate PCSIM from within your DOS              
session.                                                                       
SOLUTION:                                                                       
NOTE:  ##############################################################           
#####################################################################           
##                                                                 ##           
## This item contains characters that may not print or display     ##           
## correctly on all systems.  A flag line has been placed BENEATH  ##           
## each line that contains one or more of those characters.  Flag  ##           
## lines can be identified by the characters "@@" in columns 71    ##           
## and 72.  The position of each unprintable or non-displayable    ##           
## character is identified by one of the following letters         ##           
## contained in the flag line and located directly beneath that    ##           
## character.                                                      ##           
##                                                                 ##           
##    A - left square bracket          G - logical not             ##          
##    B - right square bracket         H - exclamation point       ##           
##    C - left brace                   I - vertical bar            ##           
##    D - right brace                  J - back slash              ##           
##    E - percent sign                 K - tilde                   ##           
##    F - caret (circumflex)           L - back quote (accent)     ##           
##                                                                 ##           
#####################################################################           
#####################################################################           
This method assumes that you have a queue names 'bsh' defined in your           
AIX system. This queue is used to accept the Unix 'kill' command.               
The kill command will be used to terminate the DOS session.                     
The two line shell program 'start_pcsim.sh' (shown below) is used to            
start your DOS session:                                                         
pcsim -C /u/DOS_pcsim_DIR/pcsimHD0 -mouse com1 -dmode V -A 3                   
-xmemory 2048 -lpt1 pcl -lpt2 bsh &                                             
echo $| > /tmp/pcsim.pid                                                        
      I                                                               @@        
Notice that there are two DOS printer ports defined: lpt1 and lpt2.             
In this example lpt1 is defined as a HP pcl printer. The second                 
printer port is used to send the kill command to the 'bsh' queue.               
Notice that this command is followed by a '&' to start PCSIM as a               
background process. The second line of this shell script creates a              
file called '/tmp/pcsim.pid'. This file simply contains the pid of the          
PCSIM session.                                                                  
Within the DOS session you will execute the following batch file                
"die.bat', to terminate your PCSIM session. (a DOS executable should            
be able to do the same thing).                                                  
echo kill `cat /tmp/pcsim.pid` > lpt2:                                         
          L                  L                                        @@        
Notice that the 'cat' command is enclose in back ticks (found next to           
the 1 key). This command uses the DOS echo command to send the kill             
command to printer port 2 (Unix bsh queue).                                     
REFERENCES:                                                                     
Using the Queueing System, page 3-12 of Managing the Operating                  
System  (SC23-2293)                                                             
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                                
                                                                                
This item was created from library item Q613512 1993 BWWQZ                      
                                                                                
S e a r c h - k e y w o r d s:                                                 
APPLICAT AUTOMATED BWWQZ ION IX JAN93 METHOD OZIBM PC PCSIM RISCSIM             
RISCSYSTEM RS60000 SHUTDOWN SIMULATOR SOFTWARE                                  
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000027899 ITEM: RTA000027899
Dated: 07/1998 Category: RISCOCMD
This HTML file was generated 99/06/24~12:43:10
Comments or suggestions? Contact us