Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 1.58 KB

File metadata and controls

90 lines (65 loc) · 1.58 KB

Installation

Prerequisite

  1. Python 3.10
  2. Packages required (requirements.txt)

Steps to install:

  1. Python 3.10
sudo apt install python3.10
  1. Python3-pip
sudo apt install python3-pip
  1. Python3-venv
sudo apt install python3-venv
  1. Exec below command to create venv and install requirements.txt
source setupExecEnv.sh

Cloning the Code repo:

git clone https://github.com/ganeshiva/deviceAnalytics.git
# or
# Download with out git 
wget https://github.com/ganeshiva/deviceAnalytics/archive/refs/heads/main.zip -O deviceAnalytics.zip
unzip deviceAnalytics.zip

Installing Code dependencies:

cd deviceAnalytics source ./setupExecEnv.sh

Steps to Create 'deviceAnalytics' Service:

Create a new systemd config file

sudo nano /lib/systemd/system/deviceAnalytics.service

Content of "/lib/systemd/system/deviceAnalytics.service"

�change path to suite your folder

[Unit]
 Description=DeviceAnalytics 
 After=network.target victoriametrics.service

[Service]
 Type=simple
 StartLimitBurst=5
 StartLimitInterval=0
 Restart=on-failure
 RestartSec=5
 WorkingDirectory=/home/user/deviceAnalytics/
 ExecStart=/bin/bash -c  '/home/user/deviceAnalytics/start.sh'
 ExecStop=/bin/kill -s SIGTERM $MAINPID
 
[Install]
 WantedBy=multi-user.target

Enable deviceAnalytics service

sudo systemctl daemon-reload
sudo systemctl enable deviceAnalytics.service

Check deviceAnalytics service status

sudo systemctl daemon-reload
sudo systemctl status deviceAnalytics