]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ask-password-agent: send READY=1 when we established inotify watch
authorLennart Poettering <lennart@poettering.net>
Wed, 6 Nov 2024 22:38:17 +0000 (23:38 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 2 Jan 2025 15:37:57 +0000 (16:37 +0100)
src/tty-ask-password-agent/tty-ask-password-agent.c
units/systemd-ask-password-console.service
units/systemd-ask-password-wall.service

index 4544ee8fa7d72675e3656255440cb294508bf617..214687673f839e3aabf6edd904fcd4009055dd0f 100644 (file)
@@ -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;
 
index afd0f0baad78467d3dbf1272df63b1cb4441e8d5..b8066da851ed03e25ede4201c902c695c6a41654 100644 (file)
@@ -22,4 +22,5 @@ Before=shutdown.target initrd-switch-root.target
 
 [Service]
 ExecStart=systemd-tty-ask-password-agent --watch --console
+Type=notify
 SystemCallArchitectures=native
index 18b59d99a70ac43e609bfa690f66970926870b30..c785614e1e3071887f6887f1b9690e7863c74248 100644 (file)
@@ -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