Running the Data Receiver as system services on Linux
To run Z Common Data Provider Data Receiver as system services on Linux®, you must configure the Data Receiver.
About this task
To configure the Data Receiver to run as systemd services on Linux, you must define the datareceiver.service service script, and place the script under the systemd folder. Data Receiver uses systemd to handle services on Linux.
Customize the following parameter values in the datareceiver.service
You can find the service script in the directory that you specified for copying Data Receiver files:
- The name of the user that runs the service.
- The name of the group that is associated with that user.
- The location of the executable Data Receiver shell script. Ensure that the file path is an absolute path.
Copy the datareceiver.service script to the
/etc/systemd/system folder. If you run multiple agents on the system, use a
unique name for the script, for example, datareceiver-A.service. And ensure
that each Data Receiver service has a unique port value and a separate CDPDR_HOME
directory, and the file path <PATH_TO_SERVICE_FILE> is an absolute path.
- Reload systemd manager configuration to make the new service file take effect.
sudo systemctl daemon-reload
- Optional: Set the Data Receiver service to start automatically at
systemctl enable datareceiver.service
- To operate the systemd service of Data Receiver on Linux, run the following commands:
Action Command Start the Data Receiver service
systemctl start datareceiver
Stop the Data Receiver service
systemctl stop datareceiver
Restart the Data Receiver service
systemctl restart datareceiver
Check the status of Data Receiver service
systemctl status datareceiverNote: The dynamic logging feature of Data Receiver is not supported via systemd. You must turn on or off the trace level of the running Data Receiver service through the DataReceiver.sh script in your working directory, and only activate the tracing at the request of IBM® Support.
You can view the log messages of the service in two ways. If your systemd version is higher
than 219, you can see the Data Receiver service log messages directly on the console, and view the
log messages via the journalctl command. If your systemd version is equal to or lower than 219, you
can only view the logs via
journalctlcommand. You can use the following
journalctlcommand to view log messages. For the following example, datareceiver.service is the service that you have configured.
journalctl -u datareceiver