From 85568adde12e8f7a20b89e01e568dfdd433d95c7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 21 Nov 2017 23:02:19 +0100 Subject: prevent systemd from reporting failed with result 'protocol' A systemd service with Type=notify expects READY=1. --- bin/worker.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/worker.c b/bin/worker.c index 1ca9233..a89e8a6 100644 --- a/bin/worker.c +++ b/bin/worker.c @@ -395,9 +395,6 @@ int main(int argc, char **argv) { if ((rc = walk_askpass(passphrase)) < 0) goto out30; - /* notify systemd about success */ - sd_notify(0, "READY=1\nSTATUS=All done."); - out30: /* release Yubikey */ if (yk_release() == 0) @@ -408,6 +405,11 @@ out10: memset(challenge, 0, CHALLENGELEN + 1); memset(passphrase, 0, PASSPHRASELEN + 2); + /* notify systemd that we are ready + This does not indicate whether or not we are successful, but prevents + systemd from reporting: Failed with result 'protocol'. */ + sd_notify(0, "READY=1\nSTATUS=All done."); + return rc; } -- cgit v1.2.3-70-g09d2