How to Start HVR as Service Using Inetd in Linux
Scenario
This article explains how to run HVR as a service rather than starting the hvrremotelistener on a remote machine. For the purpose of this article, we will see how the service can be started on tcp port 4343.
Steps
As the
root
user, or a user withsudo
privilege, edit the file calledinetd.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
As the
root
user, or a user withsudo
privilege, add below line to theservices
file in the directory/etc
.hvr 4343/tcp # hvr service
- Server arguments should be option
–plogin
for PAM authentication - Environment variable for
$HVR_HOME
should be path ofhvr_home
on your machine - Environment variable for
$HVR_CONFIG
should be path ofhvr_config
on your machine - Environment variable for
$HVR_TMP
can be anytmp
location on your machine
- Server arguments should be option
Start the service using the command below:
$ /etc/init.d/openbsd-inetd start
Verify whether the service is running using the command below:
$ /etc/init.d/openbsd-inetd status
The above setup allows you to start HVR as a service. There is no need to start hvrremotelistener every time. This service is started whenever the system is rebooted.