Edit on GitHub
Auto-Starting Hub Server after Linux Rebootlink
This section describes about enabling automatic restart of HVR Hub Server when Linux machine is rebooted.
After completing the installation steps for HVR Hub, it is necessary to ensure that the HVR Hub service is restarted after the hub machine gets rebooted.
The necessary steps depend on the service management system used by the operating system:
Linux systemdlink
The following steps should be performed as user root:
Create a systemd unit file hvrhubserver.service in /etc/systemd/system directory. This unit file should contain the following:
[Unit] Description=HVR Hub Server [Service] # The process start-up type 'forking' allows this service to spawn new processes Type=forking Environment="HVR_HOME=/home/myhvr/hvr_home" Environment="HVR_CONFIG=/home/myhvr/hvr_config" Environment="HVR_TMP=/home/myhvr/hvr_tmp" # This should be user that owns HVR_HOME, HVR_CONFIG etc.. User=myhvr ExecStart=/home/myhvr/hvr_home/bin/hvrhubserver # Restart this service to after a crash Restart=always # The number of seconds to wait before attempting a restart RestartSec=5s [Install] WantedBy=multi-user.target
User must be set to the user under which HVR is installed/running.
Enable and start the service:
systemctl enable hvrhubserver systemctl start hvrhubserver
Verify whether the service is active:
systemctl status hvrhubserver
It should show output similar to this:
hvrhubserver.service - HVR HubServer Loaded: loaded (/etc/systemd/system/hvrhubserver.service; disabled; vendor preset: disabled) Active: active (running) since Mon 2020-09-12 10:03:18 EST; 14min ago Process: 7587 ExecStart=/home/myhvr/hvr_home/bin/hvrhubserver Main PID: 7588 (hvrhubserver)