Using the personal daemon
Note: Starting from version 2.0.2, the personal daemon is deprecated and will be removed in a future release. You should use the shared daemon, which has been enhanced with additional security mechanisms.
The personal daemon is started and used by a single user. Users have their own personal daemon. Therefore, the personal daemon has access to everything that the user has authority to access. The personal daemon can be started before it is used. Otherwise, the client will start the personal daemon if it is not running. If the client starts the personal daemon, the first build might take longer than subsequent builds.
The personal daemon and client use named pipes to communicate. The daemon creates a .dbb
directory in the user's home directory. It also stores a .pid
file that contains its process ID and sets up a named pipe to receive
build requests. The client sets up a named pipe in the .dbb
directory to receive responses from the build processes.
If the client starts and finds that no personal daemon is running, the client will start the personal daemon and proceed to send the build process request.
Running the personal daemon
You can run the personal daemon by using any of the following methods:
- Running the client to start a build process as described in Issuing a command.
- Calling the personal daemon directly. You can see the usage by issuing
/usr/lpp/IBM/dbb/lib/pdaemon -h
. - Using the background JCL job
BGZDBBP.jcl
provided by DBB. - Using the
personaldaemon.sh
script configured earlier in Configuring the shared and personal daemons.
Note: The JAVA_HOME
environment variable determines the Java version that is used to run the daemon. It defaults to the Java z/OS UNIX installation directories if it is not set.
Issuing a command
To issue a command to the personal 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/pclient -h
).
Examples
groovyz -DBB_PERSONAL_DAEMON /u/example/build.groovy
pclient groovyz /u/example/build.groovy
Note:
- Use fully qualified file names.
- To use with User Build, add the
-DBB_PERSONAL_DAEMON
under the additional parameters section.
Personal daemon options
Time out
The personal daemon will time out after a period of time, 8 hours by default. You can use the -t n[hms]
option to change the timeout interval. Specify a number for the timeout value. The number can be qualified as h-hours, m-minutes,
or s-seconds. If it is not qualified, the number is assumed to be hours. Use -t -1
for no timeout. If no timeout, the personal daemon will run until you issue the pclient STOP
command.
Process definitions file
The process definitions file defines all of the processes that can be started. Only one personal daemon is started if you set the count to greater than 0 in the process definitions file. You can start additional personal daemon using pclient groovyz start
.
You can use the option, -p /u/user/process_definitions.xml
, to specify a process definitions file. If it is not specified, the daemon will search the following locations:
- $HOME/.dbb/process_definitions.xml
- $DBB_CONF/process_definitions.xml
- $DBB_HOME/conf/process_definitions.xml
Managing processes
The daemon is a process coordinator that allows you to use commands to start and stop processes. The personal daemon uses the same process_definitions.xml
file as the shared daemon. However, the personal daemon starts only one process
for a definition regardless of the count. You can manually start additional processes.
For example, if more build slots are needed, you can start another process with the following command:
pclient groovyz start
Alternatively, if that process is no longer needed, you can kill it with the following command:
pclient 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.
Handling return codes
Only the return codes from System.exit()
calls in the Groovy build script are captured by the daemon. In other words, the values that are returned by the Groovy build script by using return
are not captured by the
daemon.