diff options
author | Christian Hesse <mail@eworm.de> | 2017-11-21 23:02:19 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2017-11-21 23:02:19 +0100 |
commit | 85568adde12e8f7a20b89e01e568dfdd433d95c7 (patch) | |
tree | d11fb8d7fa01505f35f8c246ced59d5c8a4068ec /bin/worker.c | |
parent | 3eb5e2e7bf013b1f7756a1556f316bf7f24c4ee3 (diff) | |
download | mkinitcpio-ykfde-85568adde12e8f7a20b89e01e568dfdd433d95c7.tar.gz mkinitcpio-ykfde-85568adde12e8f7a20b89e01e568dfdd433d95c7.tar.zst |
prevent systemd from reporting failed with result 'protocol'
A systemd service with Type=notify expects READY=1.
Diffstat (limited to 'bin/worker.c')
-rw-r--r-- | bin/worker.c | 8 |
1 files 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; } |