diff --git a/packaging/packages/synit-config/files/etc/syndicate/services/modem.pr b/packaging/packages/synit-config/files/etc/syndicate/services/modem.pr index 2faeb7e..cd3028b 100644 --- a/packaging/packages/synit-config/files/etc/syndicate/services/modem.pr +++ b/packaging/packages/synit-config/files/etc/syndicate/services/modem.pr @@ -1,7 +1,11 @@ ; Pinephone: > + up>> + + up>> + ; More generally: @@ -16,10 +20,26 @@ ? >> [ ["/usr/lib/synit/qmi-wwan-manager" $dev $apn]> + ; Occasionally qmi-wwan-manager complains on stderr about the link going away, but doesn't + ; terminate. Fortunately it doesn't seem to talk on stderr at all unless the link goes away, + ; so we interpret any stderr activity (!) as indication of a problem here. $log ?? > stream: stderr + pid: ?pid }> [ - $config ! >> + ; We used to just do this: + ; + ; $config ! >> + ; + ; ... but it immediately restarts the service, causing lots of pointless load and log spam. + ; TODO: make it so you can include an exit status in the restart request; something like + ; "restart immediately" vs "simulated normal termination" vs "simulated error termination", + ; triggering the appropriate supervisor behaviours. + ; + ; So instead we kill the qmicli program with a signal, which *does* trigger the supervisor + ; in the right way. + let ?pid = stringify $pid + $config ! ] ] diff --git a/packaging/packages/synit-config/files/usr/lib/synit/eg25-manager-monitor b/packaging/packages/synit-config/files/usr/lib/synit/eg25-manager-monitor new file mode 100755 index 0000000..512aede --- /dev/null +++ b/packaging/packages/synit-config/files/usr/lib/synit/eg25-manager-monitor @@ -0,0 +1,17 @@ +#!/bin/sh + +set -eu + +echo "Starting eg25-manager-monitor" + +device=/dev/EG25.AT + +while true +do + sleep 60 + if ! [ -e ${device} ] + then + echo "${device} not present. Sending SIGTERM to any eg25-manager processes" + killall -q -TERM eg25-manager + fi +done