Issue: Petting watchdog periodically using snapd-glib API does not have effect and reboots device.
Details:
Versions:
core18 20200427 1754 latest/beta canonical✓ base
snapd 2.45~pre1+git1579.g5da30cb 7526 latest/beta canonical✓ snapd
hw-wtdog 0.0.2.1 25 latest/beta <XYZ> -
snap name: hw-wtdog
(from brand store and with snapd-control plug)
snap declaration: From store
snapcraft.yaml (related snippet):
apps:
setpet:
(this binary is executed by another simple daemon app every 1 minute)
command: bin/setpet
plugs: [snapd-control]
Connections:
snapd-control hw-wtdog:snapd-control :snapd-control -
Code (related snippet):
g_autoptr(SnapdClient) client = snapd_client_new();
args = g_strsplit ("set;watchdog.runtime-timeout=3m", ";", -1);
result = snapd_client_run_snapctl_sync (client, ctx, args, &stdout_output, &stderr_output, NULL, &error);
g_assert_no_error (error);
g_assert_true (result);
Output:
dev@dhcppc4:~$ sudo snap get core watchdog
dev@dhcppc4:~$