0 / 0
Automatically start the Watson Query Remote Agent by adding a systemctl service on Linux

Automatically start the Watson Query Remote Agent by adding a systemctl service on Linux

Automatically start the Remote Agent when your operating system is being restarted by configuring it as a system service.

About this task

The systemctl process manager is a standard process manager on Linux® to manage service startup when your system is restarting. The following steps assume that you are using systemctl. If you are using a different process manager, then you might need to change the paths and commands.
Note: The installation prefix for IBM Java and Watson Query Remote Agent in the examples is /home/<Operating system user>/wqAgent.

Procedure

  1. As the root user, run the following command to enable user processes for systemctl. Enter the name of the operating system user.
    loginctl enable-linger <Operating system user>
    
  2. As the system user who runs the service, complete the following steps.
    1. Run the following command to create the directory for systemctl:
      mkdir -p ${HOME}/.config/systemd/user/
    2. Create a file with the following content and use a meaningful file name and description for your ongoing system administration.
    For example: .config/systemd/user/wqAgent.service
    Description=Start Watson Query Remote Agent at Boot
    After=network.target
    [Service]
    Type=simple
    user=<Operating system user>
    WorkingDirectory=/home/<Operating system user>/wqAgent
    ExecStart=/home/<Operating system user>/wqAgent/datavirtualization_start.sh
    TimeoutStartSec=0
    [Install]
    WantedBy=default.target
  3. Run the following command to enable the service:
    systemctl --user enable wqAgent 
  4. Run the following command to start the service:
    systemctl --user start wqAgent
  5. Run the following command to validate that the service is running:
    ps -axf | grep DATAVIRTUALIZATION | grep -v grep | wc -l
    
    If you are running one remote connector, this command returns a value of 1. The returned value is higher if you are running multiple remote connectors.
  6. To validate and view that the Remote Agent is running, navigate to the Data Sources page from the Watson Query web client. Each connected remote connector is displayed on a new line.
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more