FS#50486 - [autossh] add an example .service file

Attached to Project: Community Packages
Opened by jozef riha (jose1711) - Monday, 22 August 2016, 18:46 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 17 November 2016, 15:12 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

i'd welcome if autossh comes with an example .service file which user could customize in much shorter time than having to write one from scratch. here's a proposal (based on https://blog.philippklaus.de/2013/03/start-autossh-on-system-startup-using-systemd-on-arch-linux/ and http://www.matusbankovic.com/permanent-ssh-tunnel/):

[Unit]
Description=AutoSSH service for a reverse tunnel from some.example.com to localhost
After=network-online.target

[Service]
User=example_local_user
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -p 22 -l user_on_remote_server remote_server -R 11111:localhost:22222

[Install]
WantedBy=multi-user.target
This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 17 November 2016, 15:12 GMT
Reason for closing:  Won't implement
Comment by Sergej Pupykin (sergej) - Thursday, 17 November 2016, 15:12 GMT
I think it would be better to use upstream examples from /usr/share/autossh/examples/, copy, edit, and run it from .service

Loading...