From d13adf309184fb24182c1150798ae67ff5b6bb5c Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 29 Oct 2018 11:58:23 -0400 Subject: [PATCH] PDUdaemon service, conf, and script Signed-off-by: Jonathan Rajotte --- lava/pdudaemon/daemon.sh | 8 ++++++++ lava/pdudaemon/pdudaemon.conf | 18 ++++++++++++++++++ lava/pdudaemon/pdudaemon.service | 11 +++++++++++ 3 files changed, 37 insertions(+) create mode 100644 lava/pdudaemon/daemon.sh create mode 100644 lava/pdudaemon/pdudaemon.conf create mode 100644 lava/pdudaemon/pdudaemon.service diff --git a/lava/pdudaemon/daemon.sh b/lava/pdudaemon/daemon.sh new file mode 100644 index 0000000..2a83c2e --- /dev/null +++ b/lava/pdudaemon/daemon.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +WORK_DIR="$(dirname "$(readlink -f "$0")")" +VENV="${WORK_DIR}/venv/bin/activate" + +source "${VENV}" + +pdudaemon --journal --dbfile="${WORK_DIR}/pdudaemon.db" --conf="${WORK_DIR}/pdudaemon.conf" diff --git a/lava/pdudaemon/pdudaemon.conf b/lava/pdudaemon/pdudaemon.conf new file mode 100644 index 0000000..aaea8df --- /dev/null +++ b/lava/pdudaemon/pdudaemon.conf @@ -0,0 +1,18 @@ +{ + "daemon": { + "hostname": "0.0.0.0", + "port": 16421, + "dbname": "pdudaemon", + "logging_level": "DEBUG" + }, + "pdus": { + "pdu01.internal.efficios.com": { + "driver": "apc7932", + "username": "lava", + "password": "lava" + }, + "carrier-armhf.internal.efficios.com": { + "driver": "consoleserver" + } + } +} diff --git a/lava/pdudaemon/pdudaemon.service b/lava/pdudaemon/pdudaemon.service new file mode 100644 index 0000000..0a4531d --- /dev/null +++ b/lava/pdudaemon/pdudaemon.service @@ -0,0 +1,11 @@ +[Unit] +Description=Control and Queueing daemon for PDUs + +[Service] +ExecStart=/bin/bash /home/lava/pdudaemon_service/daemon.sh +Type=simple +User=lava +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target -- 2.34.1