I have a small ash script that prints memory statistics once a second:

    #!/bin/sh
    
    while true
    do
        date
        cat /proc/[0-9]*/stat |
        awk '$23 > 0 {printf "%5d %20s  %8d  %5d\n", $1, $2, $23, $24}' |
        sort -n
        sleep 60
    done

When I run that remotely via dropbea:

    $ ssh root@10.0.0.99 ./showmem.sh

Everything works as expected while the ssh session is active, but when
I end the ssh connection, the shell script never terminates: it
continues to run (indifinitely, AFAICT). I don't recall this happening
when we used to use openssh's server. Is there any way to get dropbear
to terminate a "child" program when the ssh session closes?




Reply via email to