From 254649d5762540ade590909c70c27af86c7dfdac Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 6 Nov 2024 23:38:17 +0100 Subject: [PATCH] ask-password-agent: send READY=1 when we established inotify watch --- src/tty-ask-password-agent/tty-ask-password-agent.c | 4 ++++ units/systemd-ask-password-console.service | 1 + units/systemd-ask-password-wall.service | 1 + 3 files changed, 6 insertions(+) diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 4544ee8fa7d..214687673f8 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -21,6 +21,7 @@ #include "build.h" #include "conf-parser.h" #include "constants.h" +#include "daemon-util.h" #include "devnum-util.h" #include "dirent-util.h" #include "exit-status.h" @@ -393,6 +394,9 @@ static int process_and_watch_password_files(bool watch) { pollfd[FD_INOTIFY] = (struct pollfd) { .fd = notify, .events = POLLIN }; } + _unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = + notify_start(NOTIFY_READY, NOTIFY_STOPPING); + for (;;) { usec_t timeout = USEC_INFINITY; diff --git a/units/systemd-ask-password-console.service b/units/systemd-ask-password-console.service index afd0f0baad7..b8066da851e 100644 --- a/units/systemd-ask-password-console.service +++ b/units/systemd-ask-password-console.service @@ -22,4 +22,5 @@ Before=shutdown.target initrd-switch-root.target [Service] ExecStart=systemd-tty-ask-password-agent --watch --console +Type=notify SystemCallArchitectures=native diff --git a/units/systemd-ask-password-wall.service b/units/systemd-ask-password-wall.service index 18b59d99a70..c785614e1e3 100644 --- a/units/systemd-ask-password-wall.service +++ b/units/systemd-ask-password-wall.service @@ -15,4 +15,5 @@ After=systemd-user-sessions.service [Service] ExecStartPre=-systemctl stop systemd-ask-password-console.path systemd-ask-password-console.service systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service ExecStart=systemd-tty-ask-password-agent --wall +Type=notify SystemCallArchitectures=native -- 2.47.3