Using the shared daemon
Note: The shared daemon should be used only on IBM Z Systems Development and Test Environment (ZD&T). It is not supported on an IBM Z LPAR.
The shared daemon can be used by multiple users. The shared daemon must be started before any user tries to start a build that uses the shared daemon. The user that starts the shared daemon must have authority to access the files that any build process might access during a user's build.
The shared daemon and client use sockets to communicate. The daemon listens to a port for requests and sends output and responses from the build processes back to the client via a socket.
Note: Socket communication between the client and server is unsecured. There is no authentication of the requests in the shared daemon. Also the user that starts the shared daemon must have RACF authority to resources needed
by every request.
The following examples for using the shared daemon assume that you are using host 127.0.0.1 and port 8080. The actual host and port you use depends on your setup.
Running the shared daemon
You can run the shared daemon by using any of the following methods:
- Calling the shared daemon directly. You can see the usage by issuing
/usr/lpp/IBM/dbb/lib/sdaemon -h. - Using the background JCL job
DBBS.jclprovided by DBB. - Using the
startdaemon.shscript configured earlier in DBB daemon files.
Issuing a command
To issue a command to the shared daemon, you must use the daemon client. The client can be accessed by using groovyz or calling the client directly (/usr/lpp/IBM/dbb/lib/sclient -h).
Examples
groovyz -DBB_DAEMON_HOST 127.0.0.1 -DBB_DAEMON_PORT 8080 /u/example/build.groovysclient 127.0.0.1 groovyz /u/example/build.groovy
Note:
- Use fully qualified file names.
DBB_DAEMON_HOSTandDBB_DAEMON_PORTare required.- To use with User Build, add the
-DBB_DAEMON_HOST {your server host} and -DBB_DAEMON_PORT {your daemon port}under the additional parameters section.
Managing processes
The daemon is a process coordinator that enables you to use commands to start and stop processes.
For example, if more build slots are needed, you can start another process with sclient 127.0.0.1 8080 groovyz start.
Alternatively, if that process is no longer needed, you can kill it by using sclient 127.0.0.1 8080 groovyz kill.
If the daemon receives an exception from the script that it is running, that process will be restarted.
Additional information
Running multiple builds concurrently
The daemon can have multiple processes, which support multiple builds. For example, you can build two applications at the same time, or multiple people can run their own builds at the same time.
Handling return codes
Only the return codes from System.exit() calls in the Groovy build script are captured by the daemon. In other words, values returned by the Groovy build script by using return are not captured by the daemon.