Adding restart watchdog and moving to i0t.app
This commit is contained in:
47
Makefile
47
Makefile
@@ -24,7 +24,7 @@ else
|
||||
UDEV_RULE := /etc/udev/rules.d/99-streamdeck.rules
|
||||
endif
|
||||
|
||||
.PHONY: build build-helper build-init install install-helper uninstall uninstall-helper udev
|
||||
.PHONY: build build-helper build-init install install-helper install-watchdog uninstall uninstall-helper uninstall-watchdog udev
|
||||
|
||||
# ── Build ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -88,6 +88,37 @@ install-helper: build-helper
|
||||
@echo " or run: newgrp $(GROUP)"
|
||||
endif
|
||||
|
||||
# Install the watchdog timer that detects USB unplug/replug and restarts the
|
||||
# service when the daemon's in-process reconnect misses an event. Linux only.
|
||||
ifeq ($(OS),Darwin)
|
||||
WATCHDOG_PLIST := $(LAUNCHAGENTS)/com.woodarddigital.streamdeck-go-watchdog.plist
|
||||
WATCHDOG_LOG := $(HOME)/Library/Logs/streamdeck-go-watchdog.log
|
||||
install-watchdog:
|
||||
mkdir -p $(BIN_DIR) $(LAUNCHAGENTS) $(HOME)/Library/Logs
|
||||
install -m 755 systemd/streamdeck-go-watchdog.sh $(BIN_DIR)/streamdeck-go-watchdog
|
||||
# Substitute the binary and log paths into the plist.
|
||||
sed -e 's|STREAMDECK_WATCHDOG_PATH|$(BIN_DIR)/streamdeck-go-watchdog|' \
|
||||
-e 's|STREAMDECK_WATCHDOG_LOG_PATH|$(WATCHDOG_LOG)|g' \
|
||||
launchd/com.woodarddigital.streamdeck-go-watchdog.plist > $(WATCHDOG_PLIST)
|
||||
# Reload: bootout (ignore if not loaded) then bootstrap.
|
||||
launchctl bootout gui/$$(id -u)/com.woodarddigital.streamdeck-go-watchdog 2>/dev/null || true
|
||||
launchctl bootstrap gui/$$(id -u) $(WATCHDOG_PLIST)
|
||||
@echo ""
|
||||
@echo "Watchdog installed. Fires every 30s."
|
||||
@echo " Logs: $(WATCHDOG_LOG)"
|
||||
else
|
||||
install-watchdog:
|
||||
install -Dm755 systemd/streamdeck-go-watchdog.sh $(BIN_DIR)/streamdeck-go-watchdog
|
||||
install -Dm644 systemd/streamdeck-go-watchdog.service $(SYSTEMD_USER)/streamdeck-go-watchdog.service
|
||||
install -Dm644 systemd/streamdeck-go-watchdog.timer $(SYSTEMD_USER)/streamdeck-go-watchdog.timer
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now streamdeck-go-watchdog.timer
|
||||
@echo ""
|
||||
@echo "Watchdog timer installed and started."
|
||||
@echo " Status: systemctl --user status streamdeck-go-watchdog.timer"
|
||||
@echo " Logs: journalctl --user -u streamdeck-go-watchdog.service"
|
||||
endif
|
||||
|
||||
# udev: Linux-only device permission rule.
|
||||
udev:
|
||||
ifeq ($(OS),Darwin)
|
||||
@@ -116,6 +147,12 @@ uninstall:
|
||||
uninstall-helper:
|
||||
@echo "No helper daemon on macOS — nothing to uninstall."
|
||||
@echo "Whitelist at $(CONFIG_DIR)/privileged.yaml preserved."
|
||||
|
||||
uninstall-watchdog:
|
||||
launchctl bootout gui/$$(id -u)/com.woodarddigital.streamdeck-go-watchdog 2>/dev/null || true
|
||||
rm -f $(WATCHDOG_PLIST)
|
||||
rm -f $(BIN_DIR)/streamdeck-go-watchdog
|
||||
@echo "Watchdog uninstalled."
|
||||
else
|
||||
uninstall:
|
||||
systemctl --user disable --now streamdeck-go.service || true
|
||||
@@ -124,6 +161,14 @@ uninstall:
|
||||
systemctl --user daemon-reload
|
||||
@echo "Uninstalled. Config at $(CONFIG_DIR) preserved."
|
||||
|
||||
uninstall-watchdog:
|
||||
systemctl --user disable --now streamdeck-go-watchdog.timer || true
|
||||
rm -f $(BIN_DIR)/streamdeck-go-watchdog
|
||||
rm -f $(SYSTEMD_USER)/streamdeck-go-watchdog.service
|
||||
rm -f $(SYSTEMD_USER)/streamdeck-go-watchdog.timer
|
||||
systemctl --user daemon-reload
|
||||
@echo "Watchdog uninstalled."
|
||||
|
||||
uninstall-helper:
|
||||
sudo systemctl disable --now streamdeck-go-helper.service || true
|
||||
sudo rm -f $(SYS_BIN)/$(HELPER)
|
||||
|
||||
Reference in New Issue
Block a user