How To: Start hvr as service using xinetd in linux?
Scenario:
This article explains how to run hvr as a service rather than starting the hvrremotelistener on remote machine. For the purpose of this article we will see how the service can be started on tcp port 4343
Steps:
Step 1] Add hvr service in xinetd.d directory on the remote unix machine
A] Become root on your server
# su root
B] Navigate to folder /etc/xinetd.d
# cd /etc/xinetd.d
C] Create new service called hvr as a root user
D] Edit (# vi hvr) and insert the below contents in hvr file
service hvr { socket_type = stream wait = no user = root server = /u01/app/hvr/hvr_home/bin/hvr server_args = -r -plogin env += HVR_HOME=/u01/app/hvr/hvr_home env += HVR_CONFIG=/u01/app/hvr/hvr_config env += HVR_TMP=/tmp disable = no cps = 10000 30 per_source = 100 instances = 500 }
- If it is a root user leave server_args as '–r' and use -plogin for PAM authentication
- Server should point to the hvr in $HVR_HOME directory
- Environment variable for $HVR_HOME should be path of hvr_home
- Environment variable for $HVR_CONFIG should be path of hvr_config
- Environment variable for $HVR_TMP can be any tmp location
You should see 'hvr' under xinetd.d directory
Step 2] Edit services in text format on unix
A] Usually this is found under /etc
# vi /etc/services
B]Add a line to reflect hvr service as shown below
C] Save the file
D] As root, restart the xinetd service as a root
# service xinetd restart
Step 3] Check the status of xinetd.d service to check if it is running.
# service xinetd status
The above setup allows you to start hvr as a service and there is no need to start hvrremotelistener every time. While connecting to this remote location the location configuration will look like below.