Remote program doesn't terminate when ssh session ends
Grant Edwards
grant.b.edwards at gmail.com
Fri Feb 26 01:48:34 AWST 2021
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 at 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?
More information about the Dropbear
mailing list