From ea19615599f00a48a54e5f908f019a114a6c0333 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 10 Oct 2018 09:46:09 +0300 Subject: [PATCH] added install.sh and changed some file names --- geoparser.service => geostat.service.template | 7 +++-- install.sh | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) rename geoparser.service => geostat.service.template (58%) create mode 100755 install.sh diff --git a/geoparser.service b/geostat.service.template similarity index 58% rename from geoparser.service rename to geostat.service.template index 3ba9b04..4a05964 100644 --- a/geoparser.service +++ b/geostat.service.template @@ -1,14 +1,13 @@ -***GeoStat.service*** - [Unit] Description=GeoStat After=network.target +StartLimitIntervalSec=0 [Service] Type=simple -ExecStart=/opt/geostat/venv/bin/python geoparser.py +ExecStart=$PWD/venv/bin/python geoparser.py User=root -WorkingDirectory=/opt/geostat +WorkingDirectory=$PWD Restart=always RestartSec=2 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..5f9ed01 --- /dev/null +++ b/install.sh @@ -0,0 +1,26 @@ +#! /usr/bin/env bash + +## +## Installetion for GeoStat script +## + +echo "Creating virtual ENV and installing requirements..." + +virtualenv venv && source venv/bin/activate + +pip install -r requirements.txt + +cp settings.ini.back settings.ini + +"${VISUAL:-"${EDITOR:-vi}"}" "settings.ini" + +while read line +do + eval echo "$line" +done < "./geostat.service.template" > /lib/systemd/system/geostat.service + +systemctl enable geostat.service + +echo "All done, now you can start getting GEO data from your log" +echo "run 'systemd start geostat.service' " +echo "Good Luck"