How To: Start hvr as a service using inetd 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] As the root user, or a user with sudo privilege, edit the file called inetd.conf in the directory /etc to add the following contents:
hvr stream tcp nowait root /home/hvr/hvr_home/bin/hvr hvr -r -plogin -EHVR_HOME=/home/hvr/hvr_home -EHVR_CONFIG=/home/hvr/hvr_config -EHVR_TMP=/tmp
Step 2] As the root user, or a user with sudo privilege, add below line to the services file in the directory /etc
hvr 4343/tcp # hvr service
1) Server arguments should be option –plogin for PAM authentication
2) Environment variable for $HVR_HOME should be path of hvr_home on your machine
3) Environment variable for $HVR_CONFIG should be path of hvr_config on your machine
4) Environment variable for $HVR_TMP can be any tmp location on your machine
Step 3] Start the service using below command
$ /etc/init.d/openbsd-inetd start
Step 4] Verify whether service is running using below command.
$ /etc/init.d/openbsd-inetd status
The above setup allows you to start hvr as a service and there is no need to start hvrremotelistener every time and this service is started whenever the system is rebooted.