From 632c48ea5453f4417c5bb2ea7d846987bbe92213 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 6 Oct 2024 10:51:41 -0500 Subject: [PATCH] attempt to package Signed-off-by: Jeff Carr --- .gitignore | 1 + build | 5 +++++ control | 2 ++ powerpaneld.service | 14 ++++++++++++++ 4 files changed, 22 insertions(+) create mode 100755 build create mode 100644 powerpaneld.service diff --git a/.gitignore b/.gitignore index 6f0a7cc..730ce16 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ go.mod go.sum powerpaneld +files/ diff --git a/build b/build new file mode 100755 index 0000000..7c84cf6 --- /dev/null +++ b/build @@ -0,0 +1,5 @@ +#!/bin/bash -x + +# this is the systemd control file +mkdir -p files/lib/systemd/system/ +cp powerpaneld.service files/lib/systemd/system/ diff --git a/control b/control index 2bc96a0..8004dc9 100644 --- a/control +++ b/control @@ -4,6 +4,8 @@ Package: powerpaneld Maintainer: Jeff Carr Architecture: amd64 Depends: powerpanel +URL: https://git.wit.org/jcarr/powerpaneld.git Description: serves cyberpower UPS data on http for uptime checks simply dumps the status of the UPS to port 3000 so uptime checks can monitor utility power grid failures + systemctl enable powerpaneld.service diff --git a/powerpaneld.service b/powerpaneld.service new file mode 100644 index 0000000..02cea73 --- /dev/null +++ b/powerpaneld.service @@ -0,0 +1,14 @@ +[Unit] +Description=powerpaneld + +[Service] +User=root +Type=forking +ExecStart=/usr/bin/powerpaneld +ExecStop=killall powerpaneld +TimeOutSec=30 +Restart=on-failure +RestartSec=30 + +[Install] +WantedBy=multi-user.target