Job Management Partner 1/Software Distribution Client Description and User's Guide
To check the execution result of remote installation, execute the rdssts command of the client services. The rdssts command checks the operation status from the end code. To judge the end code of the command, create a shell program. When a shell file is created, the file judges the end code after remote installation. This allows you to execute user programs that match the status.
This section describes how to check remote installation using a shell program.
- Organization of this subsection
- (1) Processing to be written in a shell program
- (2) Example shell program
(1) Processing to be written in a shell program
Write the following in the shell program:
- Execute remote installation (rdsft -a command of the client services).
- Check the execution result of remote installation (rdssts command of the client services).
- Judge the end code and execute the user program.
By storing this shell program under the /etc/UAP/pwon.d/ directory, remote installation and startup of the user program are automatically executed when the system starts.
(2) Example shell program
The following is an example of a shell program for JP1/Software Distribution Client.
rdsft -a # Executes the remote installation command for i in 0 1 2 3 4 5 6 7 8 9 # and monitors the operation status of do # JP1/SD Client within 10 loops. /usr/bin/rdssts # Executes the rdssts command EXTCODE=$? case $EXTCODE in # to judge the end code. 0 ) # Executes the user program and /usr/works/bin/calc # ends the shell program since exit 0 # JP1/SD Client normally ended. ;; 1 ) # Waits for 5 seconds and remonitors sleep 5 # since JP1/SD Client is operating. ;; 254 ) # Since JP1/SD Client has abnormally ended, the /bin/echo "Remote installation failed. Contact system administrator." exit 11 # message appears and the processing ends. ;; 255 ) # A JP1/SD Client initialization error occurred, /bin/echo "Remote installation failed. Contact system administrator." exit 12 # so a message appears and the processing ends. ;; esac done /bin/echo "Remote installation is not ended. Reexecute." exit 1 # A message appears and the processing ends.
All Rights Reserved. Copyright (C) 2009, Hitachi, Ltd.