FYI, service watchdog support has landed in master. The service can specify desired watchdog timeout by adding watchdog-timeout
property in its declaration:
name: foo
version: 1.0
apps:
i-want-watchdog:
command: bin/app
daemon: simple
watchdog-timeout: 1s
restart-condition: never
plugs: [daemon-notify]
As the watchdog is actually driven/tracked by systemd, the service needs access to systemd’s notification socket. This access is provided by daemon-notify
interface, which needs to be listed in the plugs
section. Since there were some reliability related incidents regarding the notification socket in the past, the interface is not auto connected and needs connecting manually.