added InfluxDB scripts

Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
Bernardo Carvalho
2022-12-04 23:11:57 +00:00
parent 6d144aa0f7
commit 083359805c
3 changed files with 300 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
# systemd unit file for the Python Demo Service
# copy this file to /lib/systemd/system
# sudo systemctl daemon-reload
# sudo systemctl enable python_isttok_influx.service
# https://www.codementor.io/@ufukafak/how-to-run-a-python-script-in-linux-with-systemd-1nh2x3hi0e
[Unit]
# Human readable name of the unit
Description=Python Influx write Service
After=network.target
[Service]
# Command to execute when the service is started
#ExecStart=/usr/bin/pythoni3 /usr/local/lib/python_demo_service/python_demo_service.py
ExecStart=/bin/bash -c 'cd /home/bernardo/EPICS/ISTTOK/epics/influxDB && /usr/bin/python3 isttok_to_influx.py'
# Disable Python's buffering of STDOUT and STDERR, so that output from the
# service shows up immediately in systemd's logs
Environment=PYTHONUNBUFFERED=1
# Automatically restart the service if it crashes
Restart=on-failure
# Our service will notify systemd once it is up and running
Type=notify
# Use a dedicated user to run our service
User=bernardo
[Install]
# Tell systemd to automatically start this service when the system boots
# (assuming the service is enabled)
WantedBy=default.target