misc
This commit is contained in:
parent
68933a8ec7
commit
3f10b49f04
8
Makefile
8
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
|
||||
|
|
2
send.go
2
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)
|
||||
}
|
||||
|
|
12
structs.go
12
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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue