1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

psusan manpage: suggest setsid in UML example.

When UML terminates, it kills its entire process group. The way PuTTY
invokes proxy processes, they are part of its process group. So if UML
is used directly as the proxy process, it will commit patricide on
termination.

Wrapping it in 'setsid' is overkill (it doesn't need to be part of a
separate _session_, only a separate pgrp), but it's good enough to
work around this problem, and give PuTTY the opportunity to shut down
cleanly when the UML it's talking to vanishes.
This commit is contained in:
Simon Tatham 2021-08-16 22:22:55 +01:00
parent c62b7229c1
commit 2cb38da6e9

View File

@ -198,12 +198,22 @@ And the setup script \cw{uml-psusan.sh} might look like this:
\e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
\c exec /home/simon/src/putty/misc/psusan
Now set up a PuTTY saved session as in the Docker example above, using
that \cw{linux} command as the local proxy command. You may also find
that you have to enable the bug workaround that indicates that the
server \q{Discards data sent before its greeting}, because otherwise
PuTTY's outgoing protocol greeting can be accidentally lost during UML
startup. (See
Now set up a PuTTY saved session as in the Docker example above.
Basically you'll want to use the above \cw{linux} command as the local
proxy command. However, it's worth wrapping it in \c{setsid}(\e{1}),
because when UML terminates, it kills its entire process group. So
it's better that PuTTY should not be part of that group, and should
have the opportunity to shut down cleanly by itself. So probably you
end up setting the proxy command to be something more like:
\c setsid linux mem=512M rootfstype=hostfs rootflags=/ rw \
\c con=fd:2,fd:2 ssl0=fd:0,fd:1 init=/some/path/to/uml-psusan.sh
\e iiiiiiiiiiiiiiiiiiiiiiiiiii
You may also find that you have to enable the bug workaround that
indicates that the server \q{Discards data sent before its greeting},
because otherwise PuTTY's outgoing protocol greeting can be
accidentally lost during UML startup. (See
\W{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991958}{Debian
bug #991958}.)