Skip to content

Commit

Permalink
improve systemd notification handling
Browse files Browse the repository at this point in the history
  • Loading branch information
eworm-de committed Jan 29, 2018
1 parent 4510e18 commit c480580
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/ykfde.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -405,6 +405,8 @@ int main(int argc, char **argv) {
goto out60;
}

sd_notify(0, "READY=1\nSTATUS=All done.");

rc = EXIT_SUCCESS;

out60:
Expand Down

0 comments on commit c480580

Please sign in to comment.