Autossh after powerfailuer











up vote
0
down vote

favorite












In the case of autossh what happens in the following situation:




  • if there is a powercut and on reboot an internet connection is down how does autossh handle when the internet connection returns?


The docs say the following:




There is a "starting gate" time. If the first ssh process fails within
the first few
seconds of being started, autossh assumes that it never made it "out of the starting
gate", and exits. This is to handle initial failed authentication, connection, etc.
This time is 30 seconds by default, and can be adjusted (see the AUTOSSH_GATETIME
environment variable below). If AUTOSSH_GATETIME is set to 0, then both behaviours
are disabled: there is no "starting gate", and autossh will restart even if ssh
fails on the first run with an exit status of 1. The "starting gate" time is also
set to 0 when the -f flag to autossh is used.




Or is there a recommended way to handle this case?



// run file => autossh-owncloud.service

[Unit]
Description=AutoSSH owncloud service
After=network.target

[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 30" -NT -R8080:localhost:80 user@server

[Install]
WantedBy=multi-user.target


// Run and run at boot commands used
sudo systemctl start autossh-owncloud.service
sudo systemctl enable autossh-owncloud.service









share|improve this question




























    up vote
    0
    down vote

    favorite












    In the case of autossh what happens in the following situation:




    • if there is a powercut and on reboot an internet connection is down how does autossh handle when the internet connection returns?


    The docs say the following:




    There is a "starting gate" time. If the first ssh process fails within
    the first few
    seconds of being started, autossh assumes that it never made it "out of the starting
    gate", and exits. This is to handle initial failed authentication, connection, etc.
    This time is 30 seconds by default, and can be adjusted (see the AUTOSSH_GATETIME
    environment variable below). If AUTOSSH_GATETIME is set to 0, then both behaviours
    are disabled: there is no "starting gate", and autossh will restart even if ssh
    fails on the first run with an exit status of 1. The "starting gate" time is also
    set to 0 when the -f flag to autossh is used.




    Or is there a recommended way to handle this case?



    // run file => autossh-owncloud.service

    [Unit]
    Description=AutoSSH owncloud service
    After=network.target

    [Service]
    Environment="AUTOSSH_GATETIME=0"
    ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 30" -NT -R8080:localhost:80 user@server

    [Install]
    WantedBy=multi-user.target


    // Run and run at boot commands used
    sudo systemctl start autossh-owncloud.service
    sudo systemctl enable autossh-owncloud.service









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      In the case of autossh what happens in the following situation:




      • if there is a powercut and on reboot an internet connection is down how does autossh handle when the internet connection returns?


      The docs say the following:




      There is a "starting gate" time. If the first ssh process fails within
      the first few
      seconds of being started, autossh assumes that it never made it "out of the starting
      gate", and exits. This is to handle initial failed authentication, connection, etc.
      This time is 30 seconds by default, and can be adjusted (see the AUTOSSH_GATETIME
      environment variable below). If AUTOSSH_GATETIME is set to 0, then both behaviours
      are disabled: there is no "starting gate", and autossh will restart even if ssh
      fails on the first run with an exit status of 1. The "starting gate" time is also
      set to 0 when the -f flag to autossh is used.




      Or is there a recommended way to handle this case?



      // run file => autossh-owncloud.service

      [Unit]
      Description=AutoSSH owncloud service
      After=network.target

      [Service]
      Environment="AUTOSSH_GATETIME=0"
      ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 30" -NT -R8080:localhost:80 user@server

      [Install]
      WantedBy=multi-user.target


      // Run and run at boot commands used
      sudo systemctl start autossh-owncloud.service
      sudo systemctl enable autossh-owncloud.service









      share|improve this question















      In the case of autossh what happens in the following situation:




      • if there is a powercut and on reboot an internet connection is down how does autossh handle when the internet connection returns?


      The docs say the following:




      There is a "starting gate" time. If the first ssh process fails within
      the first few
      seconds of being started, autossh assumes that it never made it "out of the starting
      gate", and exits. This is to handle initial failed authentication, connection, etc.
      This time is 30 seconds by default, and can be adjusted (see the AUTOSSH_GATETIME
      environment variable below). If AUTOSSH_GATETIME is set to 0, then both behaviours
      are disabled: there is no "starting gate", and autossh will restart even if ssh
      fails on the first run with an exit status of 1. The "starting gate" time is also
      set to 0 when the -f flag to autossh is used.




      Or is there a recommended way to handle this case?



      // run file => autossh-owncloud.service

      [Unit]
      Description=AutoSSH owncloud service
      After=network.target

      [Service]
      Environment="AUTOSSH_GATETIME=0"
      ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 30" -NT -R8080:localhost:80 user@server

      [Install]
      WantedBy=multi-user.target


      // Run and run at boot commands used
      sudo systemctl start autossh-owncloud.service
      sudo systemctl enable autossh-owncloud.service






      ssh autossh






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 14:28

























      asked Nov 20 at 14:23









      denski

      209211




      209211



























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1094538%2fautossh-after-powerfailuer%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1094538%2fautossh-after-powerfailuer%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How did Captain America manage to do this?

          迪纳利

          南乌拉尔铁路局