Skip to content

Commit

Permalink
Added systemd watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronRP committed Jan 24, 2018
1 parent c227cfd commit 9c8f812
Show file tree
Hide file tree
Showing 69 changed files with 9,185 additions and 34 deletions.
43 changes: 9 additions & 34 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/TheCacophonyProject/lepton3"
arg "github.com/alexflint/go-arg"
"github.com/coreos/go-systemd/daemon"
"periph.io/x/periph/conn/gpio"
"periph.io/x/periph/conn/gpio/gpioreg"
"periph.io/x/periph/host"
Expand Down Expand Up @@ -184,6 +185,9 @@ func runRecordings(conf *Config, camera *lepton3.Lepton3) error {
return &nextFrameErr{err}
}
totalFrames++
if totalFrames%5*framesHz == 0 {
daemon.SdNotify(false, "WATCHDOG=1")
}
if totalFrames%frameLogIntervalFirstMin == 0 &&
totalFrames <= 60*framesHz || totalFrames%frameLogInterval == 0 {
log.Printf("%d frames seen", totalFrames)
Expand Down
1 change: 1 addition & 0 deletions thermal-recorder.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ After=multi-user.target
Type=simple
ExecStart=/usr/local/bin/thermal-recorder
Restart=on-failure
WatchdogSec=30s

[Install]
WantedBy=multi-user.target
29 changes: 29 additions & 0 deletions vendor/github.com/coreos/go-systemd/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions vendor/github.com/coreos/go-systemd/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions vendor/github.com/coreos/go-systemd/DCO

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions vendor/github.com/coreos/go-systemd/Jenkinsfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9c8f812

Please sign in to comment.