From 89390153e97182c5e786f3ce539bc187164986f2 Mon Sep 17 00:00:00 2001 From: erg Date: Sun, 13 Jun 2021 11:50:28 +0200 Subject: added settings_server.cfg and RPGH: an openrc service file --- RPGH | 24 ++++++++++++++++++++++++ settings_server.cfg | 6 ++++++ 2 files changed, 30 insertions(+) create mode 100755 RPGH create mode 100644 settings_server.cfg diff --git a/RPGH b/RPGH new file mode 100755 index 0000000..e915233 --- /dev/null +++ b/RPGH @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="RPGH daemon" +description="Runs monitoring daemon on sensors, saves to files." +command=/home/pipi/.local/bin/RPGH_starter.sh +command_args="${RPGH_args}" +pidfile=/var/run/RPGH_starter.pid + +depend() { + need pigpiod + +} +start() { + ebegin "Starting RPGH daemon" + start-stop-daemon -u pipi:pipi --start --exec /usr/bin/python --background --make-pidfile --pidfile /var/run/RPGH_starter.pid /var/git/RPGH_repo/monitor_unified.py + eend $? +} +stop() { + ebegin "Stopping RPGH daemon" + start-stop-daemon --stop --signal 15 --exec /var/git/RPGH_repo/monitor_unified.py --pidfile /var/run/RPGH_starter.pid --stop + eend $? +} diff --git a/settings_server.cfg b/settings_server.cfg new file mode 100644 index 0000000..b109890 --- /dev/null +++ b/settings_server.cfg @@ -0,0 +1,6 @@ +[mysql] +host = localhost +user = vlad +password = hoP-Topapo +unix_socket = /var/run/mysqld/mysqld.sock +database = tescik -- cgit v1.2.3-65-gdbad