This service kills open SSH sessions on shutdown, so when you run shutdown/reboot/poweoff, your PuTTY will clearly show the session being disconnected. On a raw server system (no systemd-logind active) otherwise your SSH session will look like active still for a really long time, causing confusion.
https://github.com/MichaIng/DietPi/blob ... service#L7
You could try this by yourself:
- Open an SSH session
- Connect to local terminal (keyboard + monitor)
- Run on local terminal:
killall -qw dropbear sshd
- See if the command finishes immediately or hangs there as well.
If was already thinking to remove the
-w option, as this means "wait for processes to be killed". But if somehow the processes hang or do not react to the default SIGTERM, the killall command will wait forever. To assure most quick kill, SIGKILL and no
-w would be best but rude as well to any running sub process.
However please try the above to investigate why the killall hangs.
And in case do to not have the command wait:
Code: Select all
sed -i 's/killall -qw/killall -q/' /etc/systemd/system/dietpi-kill_ssh.service
systemctl daemon-reload
Or even, to send the rude SIGKILL command which cannot be ignored by processes:
Code: Select all
sed -Ei 's/killall -qw?/killall -9 -q/' /etc/systemd/system/dietpi-kill_ssh.service
systemctl daemon-reload