I have a local unix socket tunneled to another unix socket on a remote instance over SSH:
ssh -N -L $HOME/my.sock:/var/run/another.sock
however, when I terminate ssh gracefully (i.e. ctrl+C or SIGTERM), the
$HOME/my.sock remains. It looks like this is not cleaned up properly. Is there an option/flag for this?
This is problematic because if I run the command for the second time, it fails due to existing socket file. (I can't see a "reuse" flag/option either that’ll overwrite the existing socket file.) And I much rather don’t add a
rm -f $HOME/my.sock.