Skip to content

Instantly share code, notes, and snippets.

@adrianharabula
Created September 17, 2017 07:31
Show Gist options
  • Save adrianharabula/91a24103f27c91e60f51016f8c3c192b to your computer and use it in GitHub Desktop.
Save adrianharabula/91a24103f27c91e60f51016f8c3c192b to your computer and use it in GitHub Desktop.
autossh startup script for openrc init on alpine linux
#!/sbin/openrc-run
#/etc/init.d/autossh
name="busybox $SVCNAME"
command="/usr/bin/autossh"
command_args="-M 0 -f -T -N connection"
command_user="root"
pidfile="/run/$SVCNAME/$SVCNAME.pid"
command_background="yes"
depend() {
need net localmount
after firewall
}
@def324
Copy link

def324 commented Oct 16, 2020

I had to add the following at the beginning to make it stop correctly:

AUTOSSH_PIDFILE="/run/$SVCNAME/$SVCNAME.pid"
export AUTOSSH_PIDFILE

@adrianharabula
Copy link
Author

adrianharabula commented Oct 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment