Configuring an independent integration server startup script
You can configure an independent integration server to run a script when it starts up, by setting properties in the independent integration server's server.conf.yaml configuration file. By using this capability, you can run commands to reconfigure the independent integration server at startup. This capability is not available for an integration server that is associated with an integration node.
Before you begin
- Create an independent integration server, as described in Creating an integration server.
- Configure the independent integration server, by following the instructions in Configuring an integration server by modifying the server.conf.yaml file.
About this task
You can configure an independent integration server to run a script when it is started, by modifying the StartupScripts section of the server.conf.yaml file, in which you specify the script to be run. For example:
StartupScripts:
FirstScript:
command: '/tmp/myscript.sh'
#readVariablesFromOutput: 'auto' # Controls whether the server reads environment and user variables from the script output.
# Possible values are 'true', 'false', and 'auto' (default).
directErrorToCommandOutput: false # Specify whether the stderr output of the command should be redirected to the stdout stream
# and read by the integration server. Default is false.
includeCommandOutputInLogs: true # Specify whether the output from the command should appear in log and user trace messages.
# Default is true.
#stopServerOnError: true # Specify whether the server stops if script returns a non-zero exit code. Default is true.
In this example, the script /tmp/myscript.sh is run when the independent
integration server starts. This script contains the following logic, which uses curl to copy the
files needed for a policy override from a GitHub repository into an overrides
directory:
mkdir /tmp/myworkdir/overrides/MQ
cd /tmp/myworkdir/overrides/MQ
curl -o .project https://raw.githubusercontent.com/jsmith/my-example-repo/main/MQ/.project
curl -o policy.descriptor https://raw.githubusercontent.com/jsmith/my-example-repo/main/MQ/policy.descriptor
curl -o MQ.policyxml https://raw.githubusercontent.com/jsmith/my-example-repo/main/MQ/MQ.policyxml
When the independent integration server starts, the following output is returned from the
IntegrationServer
command:
[jsmith@greys1 myworkdir]$ IntegrationServer --work-dir /tmp/myworkdir
2022-11-28 16:16:29.951740: BIP1990I: Integration server 'myworkdir' starting initialization; version '12.0.7.0' (64-bit)
2022-11-28 16:16:29.952722: BIP9560I: Script 'FirstScript' is about to run using command '/tmp/myscript.sh'.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 508 100 508 0 0 1587 0 --:--:-- --:--:-- --:--:-- 1592
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 245 100 245 0 0 696 0 --:--:-- --:--:-- --:--:-- 694
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 712 100 712 0 0 2131 0 --:--:-- --:--:-- --:--:-- 2138
2022-11-28 16:16:31.108048: BIP9565I: Script 'FirstScript' has run successfully.
2022-11-28 16:16:31.122500: BIP9905I: Initializing resource managers.
2022-11-28 16:16:37.920092: BIP9906I: Reading deployed resources.
2022-11-28 16:16:37.922364: BIP9907I: Initializing deployed resources.
2022-11-28 16:16:38.810972: BIP2866I: IBM App Connect Enterprise administration security is inactive.
2022-11-28 16:16:38.826016: BIP3132I: The HTTP Listener has started listening on port '7600' for 'RestAdmin http' connections.
2022-11-28 16:16:38.830832: BIP1991I: Integration server has finished initialization.
Procedure
To configure an independent integration server to use a startup script, complete the following steps: