attempt to package

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-06 10:51:41 -05:00
parent 7b196bca76
commit 632c48ea54
4 changed files with 22 additions and 0 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ go.mod
go.sum go.sum
powerpaneld powerpaneld
files/

5
build Executable file
View File

@ -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/

View File

@ -4,6 +4,8 @@ Package: powerpaneld
Maintainer: Jeff Carr <jcarr@wit.com> Maintainer: Jeff Carr <jcarr@wit.com>
Architecture: amd64 Architecture: amd64
Depends: powerpanel Depends: powerpanel
URL: https://git.wit.org/jcarr/powerpaneld.git
Description: serves cyberpower UPS data on http for uptime checks Description: serves cyberpower UPS data on http for uptime checks
simply dumps the status of the UPS to port 3000 so uptime checks simply dumps the status of the UPS to port 3000 so uptime checks
can monitor utility power grid failures can monitor utility power grid failures
systemctl enable powerpaneld.service

14
powerpaneld.service Normal file
View File

@ -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