[systemd-devel] Setting Up SSH Tunnels

CACook at Quantum-Sci.com CACook at Quantum-Sci.com
Fri Jul 5 13:13:00 PDT 2013


Reindl Harald:
>> But does this mean I have to have over 20 .services for my reverse tunnels?
>> They could all start in parallel, but is there no better way?
>
> this is a *perfect* way and the only one "Restart=always" can work relieable
> no matter how many of them, build one, test it carefully and copy it as often
> as need with the minimal change of port/host, that's hardly more work than
> a unrelieable wrapper script
>
> with the small script below i see the status of all forwarding-services
> including all ssh processes with their params and the last restart-time
>
> what more does someone need to manage this out-of-the-box?
> ________________________________________________
>
> cat /usr/local/bin/forwardings.sh
> #!/usr/bin/bash
> if [ "$1" == "" ]; then
>   ACTION="status"
> else
>
>   ACTION="$1"
> fi
>
> /usr/bin/systemctl $ACTION forward-host1.service forward-host2.service...................
> ________________________________________________
>
>> Would they wake from sleep? Would they auto-restart if a broken pipe?
>
> anything which let die the "ssh" process results in restart

Thank you Reindl.  I have put off researching this for -years- as I'd 
doubted anyone else would know what the heck I'm talking about.  But 
you've gotten me fixed up!



More information about the systemd-devel mailing list