From c480580cf97917e0e77c583fb5efdb5282835ed7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 29 Jan 2018 10:47:53 +0100 Subject: improve systemd notification handling --- bin/ykfde.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/ykfde.c b/bin/ykfde.c index eac69c0..e01f82b 100644 --- a/bin/ykfde.c +++ b/bin/ykfde.c @@ -267,7 +267,7 @@ int main(int argc, char **argv) { /* try to get a second factor */ if (iniparser_getboolean(ini, "general:" CONF2NDFACTOR, 0) > 0 && second_factor == NULL && new_2nd_factor == NULL) { - if (sd_notify(0, "STATUS=0") == 0) + if (sd_notify(0, "READY=0\nSTATUS=Detecting systemd...") == 0) fprintf(stderr, "Not running from systemd, you may have to give\n" "second factor manually if required.\n"); else if ((key = keyctl_search(KEY_SPEC_USER_KEYRING, "user", "ykfde-2f", 0)) < 0) @@ -405,6 +405,8 @@ int main(int argc, char **argv) { goto out60; } + sd_notify(0, "READY=1\nSTATUS=All done."); + rc = EXIT_SUCCESS; out60: -- cgit v1.2.3-54-g00ecf