The PIF product MERCHANT must create the database tables after the product files have been installed. Due to the specifications of the product MERCHANT, the user-written script file create_tables.sh will do this.
The script file properties are specified in the component section, as follows:
@COMPONENT: #chead: component1 ; #dir: bin , root , sys , drwxrwxrwx ; #file: bin/merchant.jar , /myhomepath/src/merchant.jar, root , sys , -r—r—r-- , 1 ; #file: bin/run_merchant.sh , /myhomepath/scripts/run_merchant.sh, root , sys , -r-xr-xr-x , 1 ; #slink: /usr/bin/run_merchant.sh , bin/run_merchant.sh ; #file: bin/create_tables.sh , /myhomepath/scripts/create_tables.sh , root , sys , -r-xr-xr-x , 1 ; @ENDCOMP:
The script file create_tables.sh should be installed in the target directory bin. The source directory for the script file is /myhomepath/scripts. Owner is root, group is sys, read (r) and execute (x) access is granted for all users, and the file type is 1 meaning standard file.
The script execution time is specified in the product information section, as follows:
@PRODUCT: #phead: MERCHANT , 2.1.0.0 ; #sys: Any ; #locale: ENU ; #comment: This is an example for a PIF product ; #ppath: /home/merchant ; #pdep: Ingres , 4.0.0.0 , >= ; #postinit: bin/create_tables.sh ; @ENDPROD:
The keyword #postinit: determines that the script create_table.sh is executed after the product files have been installed.
To specify the script file create_table.sh through the command line
pifproto -n MERCHANT -v 2.1.0.0 -a Any -d /tmp/merchant -b /home/merchant -i scripts/create_tables.sh -o
Through the -i option the post-install procedure is defined. The -o switch enables overwriting the existing prototype file of the product MERCHANT.
To add a Procedure through the GUI
The Choose source file dialog appears.
The Internal procedure dialog appears.
Execution time: post installation
Procedure file: create_tables.sh
The procedure appears in the procedures list and the properties are incorporated in the prototype file of the PIF product MERCHANT.
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|