On 2020-07-04 00:30:04 +0200, Guilhem Moulin wrote:
> On Sat, 04 Jul 2020 at 00:18:59 +0200, Vincent Lefevre wrote:
> > Note that /usr/share/doc/dropbear-initramfs/README.initramfs
> > says at the end:
> > 
> >  This is non-blocking for the startup process, so when you are at the
> >  console you won't have to wait for the SSHd to complete its startup.
> 
> I happen to maintain dropbear-initramfs and wrote that :-)
> 
> While the init-premount script is non-blocking, the init-bottom is
> blocking.  This is a side effect of the #943459, but I'm not sure it's
> possible to have it both ways.  Need to do some tests to see where the
> link is detected.

I suppose that's

wait_for_dropbear() {
    local pid exe timer=60
    pid="$(cat "$PIDFILE" 2>/dev/null)" || return 1

    # when configure_networking() is run asynchronously dropbear might
    # not have started yet; ipconfig doesn't react to SIGTERM so we wait
    # for the network stack to be configured (and dropbear to start)
    # rather than terminating the shell and its children
    while [ $timer -gt 0 ] && exe="$(readlink -f "/proc/$pid/exe" 
2>/dev/null)"; do
        if [ "$exe" = "$EXE" ]; then
            echo "$pid"
            return 0
        fi
        sleep 1
        timer=$(( timer - 1))
    done
    return 1
}

Couldn't it also check whether the user has typed the passphrase,
and quit in this case? (I assume that the information is available
somewhere or can be made available.)

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to