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.

Procedure

  1. Customize the following parameter values in the datareceiver.service service script.
    You can find the service script in the directory that you specified for copying Data Receiver files:
    User
    The name of the user that runs the service.
    Group
    The name of the group that is associated with that user.
    Environment
    The location of the executable Data Receiver shell script. Ensure that the file path is an absolute path.
  2. 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.
    ./importServiceFile.sh <PATH_TO_SERVICE_FILE>/datareceiver.service
  3. Reload systemd manager configuration to make the new service file take effect.
    sudo systemctl daemon-reload
  4. Optional: Set the Data Receiver service to start automatically at startup.
    systemctl enable datareceiver.service
  5. 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 datareceiver
    Note: 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.
  6. 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 journalctl command. You can use the following journalctl command to view log messages. For the following example, datareceiver.service is the service that you have configured.
    journalctl -u datareceiver