Background Services
Background Services is a feature of HyperExecute which is generally used to run the long running Application Servers. You can trigger the background services by using either the background or backgroundDirectives property in the HyperExecute YAML file.
This feature is useful for the following cases:
- Web Applications or Servers.
- Running databases.
- Providing file sharing or streaming services.
- Running messaging or chat applications.
- Providing APIs for other applications to use.
Enable Background Service
There are two methods to enable the Background Service from the HyperExecute YAML file:
1. Using backgroundDirectives
Verified
backgroundDirectives:
shell: bash
commands:
- name: YOUR_SERVICE_NAME
command: npx static-server
- name: Database
command: mysql-server
shell: defines the terminal it should use to run the background service.command: specifies the command to be executed in the background.name: specifies the name of your Background Service.
2. Using background
Verified
background:
- npx static-server
- mysql-server
Background Service Logs
To check the background service logs, follow the below mentioned steps:
Step 1: After executing your job, go to the HyperExecute Dashboard to check the status of the job.
Step 2: Click on the Background Service button.
Step 3: Click on the desired background service you have triggered to check its logs.
Frequently Asked Questions
Is the service intended to operate within the same Virtual Machine or externally?
What is the service's commencement and cessation schedule?
Will the Database, for example, run on a single VM and be accessible for testing on other VMs?
Will the identical set of background services be initiated within every VM?
npm run server, are establishing HTTP servers on the same port, it is likely that one of the commands will encounter a binding issue and fail. 