Install the Discovery Module - Linux - Configuring the Services (with systemctl)
If your OS provides access to systemctl, follow these instructions. We want the Discovery services (daemons) to run as their own user. To do this:
- Create a new User and Group named "Discovery", as follows:
sudo groupadd Discovery
sudo useradd -M -s /bin/nologin -g Discovery -d /opt/Discovery Discovery
- Then change the owner of the Discovery directory to the new "Discovery" user:
sudo chown Discovery:Discovery /opt/Discovery -R
- If you look in Discovery's "bin" directory (/opt/Discovery/platform/bin) you'll see two scripts: logiDataService.sh and logiApplicationService.sh. Both of these scripts need to be run to start the full Discovery server. In this next section, we'll configure a service to start and stop the
Discovery
server.
First, we'll configure the application service:
sudo nano /etc/systemd/system/LogiApplicationService.service
Include these items in the LogiApplicationService.service file:
Next, for the data service:
sudo nano /etc/systemd/system/LogiDataService.service
Include these items in the LogiDataService.service file:
- Finally, run this command so systemd picks up the changes:
sudo systemctl daemon-reload
And then start the services:
sudo service LogiDataService start
sudo service LogiApplicationService start
Now run this test to see if the server responds:
curl localhost:3000
If you receive a message that says "Cannot GET /" then the installation was successful. Congratulations!
Start Services on Boot
If you'd like to have both services start on boot, do this:
sudo systemctl LogiApplicationService enable
sudo systemctl LogiDataService enable