]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
remove traces of isuma vendor
authorAntoine Beaupré <anarcat@koumbit.org>
Thu, 18 Jun 2015 19:59:16 +0000 (15:59 -0400)
committerAntoine Beaupré <anarcat@koumbit.org>
Thu, 18 Jun 2015 21:11:21 +0000 (17:11 -0400)
files/autossh.init.d
manifests/autossh.pp

index fb3c57f7d335aac2842f0e146477799bf85252d8..254fcdc0f61415e52468113210e7ec4b98926de4 100644 (file)
@@ -6,13 +6,15 @@
 # Required-Stop:       $remote_fs $syslog
 # Default-Start:       2 3 4 5
 # Default-Stop:                
-# Short-Description:   Autossh for isuma
+# Short-Description:   AutoSSH daemon
 ### END INIT INFO
 
 set -e
 
 umask 022
 
+PIDFILE=/var/run/autossh.pid
+
 if test -f /etc/default/isuma-autossh; then
     . /etc/default/isuma-autossh
 fi
@@ -23,16 +25,16 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
 case "$1" in
   start)
-       log_daemon_msg "Starting Autossh for isuma" "autossh"
-       if start-stop-daemon --quiet --start --background --pidfile /var/run/autossh-isuma.pid --make-pidfile --exec /usr/bin/autossh -- $AUTOSSH_ISUMA_OPTS; then
+       log_daemon_msg "Starting AutoSSH daemon" "autossh"
+       if start-stop-daemon --quiet --start --background --pidfile $PIDFILE --make-pidfile --exec /usr/bin/autossh -- $DAEMON_OPTS; then
            log_end_msg 0
        else
            log_end_msg 1
        fi
        ;;
   stop)
-       log_daemon_msg "Stopping Autossh for isuma" "autossh"
-       if start-stop-daemon --stop --quiet --pidfile /var/run/autossh-isuma.pid ; then
+       log_daemon_msg "Stopping AutoSSH daemon" "autossh"
+       if start-stop-daemon --stop --quiet --pidfile $PIDFILE ; then
            log_end_msg 0
        else
            log_end_msg 1
@@ -40,8 +42,8 @@ case "$1" in
        ;;
 
   reload|force-reload)
-       log_daemon_msg "Reloading Autossh for isuma's configuration" "autossh"
-       if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/autossh-isuma.pid; then
+       log_daemon_msg "Reloading AutoSSH daemon" "autossh"
+       if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE; then
            log_end_msg 0
        else
            log_end_msg 1
@@ -50,8 +52,8 @@ case "$1" in
 
   restart)
        log_daemon_msg "Restarting Autossh for isuma" "autossh"
-       start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/autossh-isuma.pid
-       if start-stop-daemon --start --quiet -b --make-pidfile  --pidfile /var/run/autossh-isuma.pid --exec /usr/bin/autossh -- $AUTOSSH_ISUMA_OPTS; then
+       start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE
+       if start-stop-daemon --start --quiet -b --make-pidfile  --pidfile $PIDFILE --exec /usr/bin/autossh -- $AUTOSSH_ISUMA_OPTS; then
            log_end_msg 0
        else
            log_end_msg 1
@@ -61,13 +63,13 @@ case "$1" in
   try-restart)
        log_daemon_msg "Restarting Autossh for isuma" "autossh"
        set +e
-       start-stop-daemon --stop --quiet --retry 30 --pidfile /var/run/autossh-isuma.pid
+       start-stop-daemon --stop --quiet --retry 30 --pidfile $PIDFILE
        RET="$?"
        set -e
        case $RET in
            0)
                # old daemon stopped
-               if start-stop-daemon --start --quiet --oknodo -b --pidfile /var/run/autossh-isuma.pid --make-pidfile --exec /usr/bin/autossh -- $AUTOSSH_ISUMA_OPTS; then
+               if start-stop-daemon --start --quiet --oknodo -b --pidfile $PIDFILE --make-pidfile --exec /usr/bin/autossh -- $AUTOSSH_ISUMA_OPTS; then
                    log_end_msg 0
                else
                    log_end_msg 1
@@ -87,7 +89,7 @@ case "$1" in
        ;;
 
   status)
-    status_of_proc -p /var/run/autossh-isuma.pid /usr/sbin/autossh autossh && exit 0 || exit $?
+    status_of_proc -p $PIDFILE /usr/sbin/autossh autossh && exit 0 || exit $?
        ;;
 
   *)
index 80d571ba17db9e2338e54e87a1cd8301f8e54c4d..e94d65b8e52c806aeb22ccc3446669b1c3ca2e15 100644 (file)
@@ -23,12 +23,16 @@ class sshd::autossh($host,
       mode    => '0444',
       content => "DAEMON_OPTS='-o ServerAliveInterval=15 -o ServerAliveCountMax=4 -q -N -R $port_ensure:localhost:22 $user_ensure@$host'\n";
   }
+  package { 'autossh':
+    ensure => present,
+  }
   service { 'autossh':
     ensure    => running,
     enable    => true,
     subscribe => [
-                File['/etc/init.d/autossh'],
-                File['/etc/default/autossh']
-                ],
+                  File['/etc/init.d/autossh'],
+                  File['/etc/default/autossh'],
+                  Package['autossh'],
+                  ],
   }
 }