diff options
author | Antoine Beaupré <anarcat@koumbit.org> | 2015-06-18 16:43:17 -0400 |
---|---|---|
committer | Antoine Beaupré <anarcat@koumbit.org> | 2015-06-18 17:15:28 -0400 |
commit | 7b99c89edf698d295dc21aba97800166c7961cf9 (patch) | |
tree | 80779210889799033ab90426f059429fb627a747 /files | |
parent | 50685a8bc739d28ab1df830c707d1091a94c08bb (diff) | |
download | puppet-sshd-7b99c89edf698d295dc21aba97800166c7961cf9.tar.gz puppet-sshd-7b99c89edf698d295dc21aba97800166c7961cf9.tar.bz2 |
make autossh fork properly
Diffstat (limited to 'files')
-rw-r--r-- | files/autossh.init.d | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/files/autossh.init.d b/files/autossh.init.d index bb1119e..92bd5f4 100644 --- a/files/autossh.init.d +++ b/files/autossh.init.d @@ -19,13 +19,16 @@ DESC="autossh" NAME=autossh USER=$NAME DAEMON=/usr/bin/autossh -DAEMON_ARGS="" +DAEMON_ARGS="-f" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME +AUTOSSH_PIDFILE=$PIDFILE +export AUTOSSH_PIDFILE + # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -46,9 +49,9 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - start-stop-daemon --start --quiet --background --user $USER --pidfile $PIDFILE --makepidfile --exec $DAEMON --test > /dev/null \ + start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 - start-stop-daemon --start --quiet --background --user $USER --chuid $USER --pidfile $PIDFILE --makepidfile --exec $DAEMON -- \ + start-stop-daemon --start --quiet --user $USER --chuid $USER --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # The above code will not work for interpreted scripts, use the next |