The goal of this gist is to setup waypipe to automically run locally on user login and remotely when you connect to it. In both cases, this is managed by systemd user session and assumes that is running. This took way too long to figure out, so I hope it helps someone (or me) in the future.
On your local system, copy the waypipe-client.service to the user systemd directory.
install -d 0755 ${HOME}/.config/systemd/user/
install waypipe-client.service ${HOME}/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now waypipe-client.serviceConfigure SSH Remote Forward by creating or amending an entry for your remote host.
It should look like the ssh_config file in this gist.
On the remote system, do similarly with waypipe-server.service.
install -d 0755 ${HOME}/.config/systemd/user/
install waypipe-server.service ${HOME}/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now waypipe-server.service
Took me some time to read and understand. Nice match + exec hack there.
I read your solution is never exiting the "control" tagged ssh process. Correct me if I'm wrong. I guess only if the connection is interrupted by something. Not sure if I like that. I tried some
-P control or master or nothing -O stop hostcommands but they only spawned more ssh processes.Regarding the
tail |ssh host catI usually do assh host sleep inforssh host sleep infinity(whatever argument works) in situations like these like dcode did.I guess I'll steal your idea of having a setup step upfront by using exec in the match line. But I'll try to use it to trigger a template version of the
waypipe-server.serviceto start the individualized remote waypipe server. I'll share my code when it's done.Thank you very much for sharing your solution!