Skip to content

Commit

Permalink
added watchdog monitoring for service hard reanimation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkv committed Jun 4, 2019
1 parent bd89f1f commit 8a11833
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions debian/local/disablescreenblank.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

screen=${1:-0}

# wait 20s for the display manager service to start and attach to screen
sleep 20
# wait 10s for the display manager service to start and attach to screen
sleep 10

/usr/bin/xset -display :$screen s off # deactivate screen saver
/usr/bin/xset -display :$screen -dpms # disable DPMS
Expand Down
6 changes: 3 additions & 3 deletions debian/octoprint-tft.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ [email protected]
After=systemd-user-sessions.service [email protected] plymouth-quit.service

[Service]
Type=notify
NotifyAccess=all
EnvironmentFile=/etc/octoprint-tft-environment
ExecStart=/usr/bin/xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -nocursor
ExecStartPost=/etc/disablescreenblank.sh 0
StandardOutput=journal
Restart=always
RestartSec=1s
TimeoutStopSec=5s
IgnoreSIGPIPE=no
WatchdogSec=10s

[Install]
WantedBy=graphical.target
Expand Down
5 changes: 5 additions & 0 deletions ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sync"
"time"

"github.com/coreos/go-systemd/daemon"
"github.com/gotk3/gotk3/gdk"
"github.com/gotk3/gotk3/gtk"
"github.com/mcuadros/go-octoprint"
Expand Down Expand Up @@ -80,6 +81,8 @@ func (ui *UI) initialize() {
ui.g = MustGrid()
ui.o.Add(ui.g)
ui.o.AddOverlay(ui.Notifications)

daemon.SdNotify(false, "READY=1")
}

func (ui *UI) loadStyle() {
Expand All @@ -97,6 +100,8 @@ func (ui *UI) loadStyle() {
var errMercyPeriod = time.Second * 30

func (ui *UI) verifyConnection() {
daemon.SdNotify(false, "WATCHDOG=1")

splash := NewSplashPanel(ui)

s, err := (&octoprint.ConnectionRequest{}).Do(ui.Printer)
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/coreos/go-systemd
Submodule go-systemd added at 95778d

0 comments on commit 8a11833

Please sign in to comment.