How to configure Hawk components as system service on RHEL7.

How to configure Hawk components as system service on RHEL7.

book

Article ID: KB0072248

calendar_today

Updated On:

Products Versions
TIBCO Hawk -
TIBCO Hawk Database Adapter -

Description

Some customers required to install Hawk components as system service, and can control it via systemctl just like NT service on windows. Below is the instruction for the way to configure it. Ideally this instruction should work for all tibco products which launched by tibco wrap. Such as administrator, bwengine, adapter, tea, hawksnmp etc...
Some steps require root privilege. You may contact your system administrator for root.

Issue/Introduction

Instructions on how to configure hawk components(like hawkagent, hawkhma, hawkevent, hawksnmp etc...) as system service on RHEL7 or CentOS7 and above. And set start on system boot.

Environment

RHEL7.x and CentOS 7.x

Resolution

Here is the example to configure hawkagent as system serivce and start on boot on RHEL7:
  1. Go to /etc/systemd/system -> create hawkagent.service file;    //Or name it as you wish, just remember the name, you will use this name in the following steps.
  2.  hawkagent.service content:
$cat /etc/systemd/system/hawkagent.service
    [Unit]
    Description=TIBCO HawkAgent
    After=syslog.service network.target

    [Service]
    Type=simple
    User=test       
    ExecStart=/<full_path>/tibhawkagent --propFile /<full_path>/tibhawkagent.tra
    KillMode=process



    [Install]
    WantedBy=multi-user.target
  1.  Run systemctl daemon-reload
  2.  Run systemctl enable hawkagent
  3. * Run systemctl start hawkagent
  4. * Set start on boot: ln -s /etc/systemd/system/hawkagent.service /etc/systemd/system/multi-user.target.wants/hawkagent.service
  5. * Unset start on boot: systemctl disable hawkagent



Note:
#5*, once you finished this configuration, you don't need the root privilege anymore. You can start/stop it with the test user.
#6* is optional. If you don't need start on boot, you can ignore #6 and #7.

FAQs:
-> User is the user we installed hawk and admin with?
    [Answer]: Generally speaking, yes. But it also allows you to set another user to run hawk if you want. Just make sure that user has the execute permission. If you are not familiar with Linux system administration, I would suggest you contact your system admin for help.

-> Will this need a password of the user?
    [Answer]: NO.

-> How to configure the same with tibco_administrator?
    [Answer]: Just create a new service file, configure it correctly, set the full path of binary file with "--propFile" + full path of .tra to ExecStart

->
 What is the KillMode used for?
    [Answer]: Default value is control-group which means systemd cleans up any child processes. For example, you use rulebases to start a process, this process would be a child process of hawkagent. When you kill hawkagent, all the processes started by rulebase would be killed together. Changing KillMode to process can avoid this.

Please contact TIBCO Support if you still have any further issues on this.
 

Additional Information

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-services