I was under the impression you are thinking about a wrapper job you
need to wrap around every job. This is a single, out of band, job. So
it may not be that bad.
You seem to imply that slaves managed by the Swarm plugin are not
'normal' ssh-based slaves, so there might be something there we can
exploit (For example, perhaps the swarm client JAR can be made to exit
once the slave is brought offline, so we can wrap it in a script that
will shut the slave down when it does).
I will look deeper into this in my POC.