misc
This commit is contained in:
parent
68933a8ec7
commit
3f10b49f04
8
Makefile
8
Makefile
|
@ -19,14 +19,12 @@ install:
|
||||||
GO111MODULE=off go install \
|
GO111MODULE=off go install \
|
||||||
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
# this is for release builds using the go.mod files
|
sudo: build
|
||||||
release-build:
|
sudo ./zood
|
||||||
@echo ${REDOMOD}
|
|
||||||
go build -v -ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}"
|
|
||||||
|
|
||||||
# makes a .deb package
|
# makes a .deb package
|
||||||
debian:
|
debian:
|
||||||
go-deb --no-gui --repo go.wit.com/lib/daemons/zood
|
go-deb --auto --repo go.wit.com/lib/daemons/zood
|
||||||
|
|
||||||
goimports:
|
goimports:
|
||||||
goimports -w *.go
|
goimports -w *.go
|
||||||
|
|
2
send.go
2
send.go
|
@ -5,6 +5,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -62,6 +63,7 @@ func sendMachine() error {
|
||||||
switch line {
|
switch line {
|
||||||
case "upgrade":
|
case "upgrade":
|
||||||
log.Info("machine upgrade now")
|
log.Info("machine upgrade now")
|
||||||
|
shell.Run([]string{"apt", "update"})
|
||||||
default:
|
default:
|
||||||
log.Info("GOT:", line)
|
log.Info("GOT:", line)
|
||||||
}
|
}
|
||||||
|
|
12
structs.go
12
structs.go
|
@ -10,11 +10,11 @@ var me *stuff
|
||||||
|
|
||||||
// this app's variables
|
// this app's variables
|
||||||
type stuff struct {
|
type stuff struct {
|
||||||
hostname string // my hostname to send to zookeeper
|
hostname string // my hostname to send to zookeeper
|
||||||
zookeeper string // the dns name for the zookeeper
|
zookeeper string // the dns name for the zookeeper
|
||||||
pollDelay time.Duration // how often to report our status
|
pollDelay time.Duration // how often to report our status
|
||||||
dog *time.Ticker // the watchdog timer
|
dog *time.Ticker // the watchdog timer
|
||||||
distro string // debian,redhat,gentoo,macos,wincrap
|
distro string // debian,redhat,gentoo,macos,wincrap
|
||||||
machine *zoopb.Machine // my protobuf
|
machine *zoopb.Machine // my protobuf
|
||||||
// packages *zoopb.Packages // installed packages and versions
|
// packages *zoopb.Packages // installed packages and versions
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ Description=zood
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/zood
|
ExecStart=/usr/bin/zood --daemon
|
||||||
ExecStop=killall zood
|
ExecStop=killall zood
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
Loading…
Reference in New Issue