summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--send.go2
-rw-r--r--structs.go12
-rw-r--r--zood.service2
4 files changed, 12 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index ef166c0..77ad3a6 100644
--- a/Makefile
+++ b/Makefile
@@ -19,14 +19,12 @@ install:
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
-# this is for release builds using the go.mod files
-release-build:
- @echo ${REDOMOD}
- go build -v -ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}"
+sudo: build
+ sudo ./zood
# makes a .deb package
debian:
- go-deb --no-gui --repo go.wit.com/lib/daemons/zood
+ go-deb --auto --repo go.wit.com/lib/daemons/zood
goimports:
goimports -w *.go
diff --git a/send.go b/send.go
index 315f59a..d9534ac 100644
--- a/send.go
+++ b/send.go
@@ -5,6 +5,7 @@ package main
import (
"strings"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/log"
)
@@ -62,6 +63,7 @@ func sendMachine() error {
switch line {
case "upgrade":
log.Info("machine upgrade now")
+ shell.Run([]string{"apt", "update"})
default:
log.Info("GOT:", line)
}
diff --git a/structs.go b/structs.go
index 3f5294a..02e9500 100644
--- a/structs.go
+++ b/structs.go
@@ -10,11 +10,11 @@ var me *stuff
// this app's variables
type stuff struct {
- hostname string // my hostname to send to zookeeper
- zookeeper string // the dns name for the zookeeper
- pollDelay time.Duration // how often to report our status
- dog *time.Ticker // the watchdog timer
- distro string // debian,redhat,gentoo,macos,wincrap
- machine *zoopb.Machine // my protobuf
+ hostname string // my hostname to send to zookeeper
+ zookeeper string // the dns name for the zookeeper
+ pollDelay time.Duration // how often to report our status
+ dog *time.Ticker // the watchdog timer
+ distro string // debian,redhat,gentoo,macos,wincrap
+ machine *zoopb.Machine // my protobuf
// packages *zoopb.Packages // installed packages and versions
}
diff --git a/zood.service b/zood.service
index e328c92..ee7d48f 100644
--- a/zood.service
+++ b/zood.service
@@ -4,7 +4,7 @@ Description=zood
[Service]
User=root
Type=simple
-ExecStart=/usr/bin/zood
+ExecStart=/usr/bin/zood --daemon
ExecStop=killall zood
Restart=on-failure
RestartSec=5