systemd service automatic restart after StartLimitInterval The 2019 Stack Overflow Developer Survey Results Are InConfiguring systemd to restart timed-out processessystemd service seems to start (uses notify) but then immediately failsHow to configure systemd to kill and restart a daemon on reload?Systemd execute command after start limit reachedService start request repeated too quickly, refusing to start limitNode.JS systemd service won't restartsystemd stops restarting serviceWhy doesn't MongoDB automatically restart?systemd cannot restart service fileImprovments for this scipt to restart each running systemd service?

Is three citations per paragraph excessive for undergraduate research paper?

Did Section 31 appear in Star Trek: The Next Generation?

Is an up-to-date browser secure on an out-of-date OS?

Does a dangling wire really electrocute me if I'm standing in water?

Walkie-talkie and its origin

What is this 4-propeller plane?

Magento2 Admin Grid Image Display

How do you say "canon" as in "official for a story universe"?

How to notate time signature switching consistently every measure

Return to UK after being refused entry years previously

Where to refill my bottle in India?

Translation norms: a dash instead of "esse"

How can I get cleveref to surround references with parentheses automatically?

Can the Protection from Evil and Good spell be used on the caster?

I am seven letter word. Find me Who Am I?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

How to manage monthly salary

How are circuits which use complex ICs normally simulated?

Is there a general name for the setup in which payoffs are not known exactly but players try to influence each other's perception of the payoffs?

Solar radiation data

I looked up a future colleague on LinkedIn before I started a job. I told him about it and he seemed surprised. Should I apologize?

How can I fix this gap between bookcases I made?

Geography at the pixel level

Why isn't airport relocation done gradually?



systemd service automatic restart after StartLimitInterval



The 2019 Stack Overflow Developer Survey Results Are InConfiguring systemd to restart timed-out processessystemd service seems to start (uses notify) but then immediately failsHow to configure systemd to kill and restart a daemon on reload?Systemd execute command after start limit reachedService start request repeated too quickly, refusing to start limitNode.JS systemd service won't restartsystemd stops restarting serviceWhy doesn't MongoDB automatically restart?systemd cannot restart service fileImprovments for this scipt to restart each running systemd service?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








25















I want my systemd service to be automatically restarted on failure. Additionally I want to rate limit the restarts. I want to allow maximum of 3 restarts within 90 seconds duration. Hence I have done the following configuration.



[Service]

Restart=always

StartLimitInterval=90

StartLimitBurst=3



Now the service is restarted on failure. After 3 Quick failures/restarts it is not restarting anymore as expected. Now I expected the systemd to start the service after the timeout (StartLimitInterval). But the systemd is not automatically starting the service after the timeout(90sec), if I manually restart the service after the timeout it is working. But I want the systemd to automatically start the service after the StartLimitInterval. Please let me know on how to achieve this feature.










share|improve this question

















  • 3





    I wrote an article that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd.

    – Benjamin
    Sep 6 '17 at 12:05







  • 2





    I think you're looking for StartLimitIntervalSec, not StartLimitInterval.

    – Marc Tamsky
    Oct 24 '17 at 17:10

















25















I want my systemd service to be automatically restarted on failure. Additionally I want to rate limit the restarts. I want to allow maximum of 3 restarts within 90 seconds duration. Hence I have done the following configuration.



[Service]

Restart=always

StartLimitInterval=90

StartLimitBurst=3



Now the service is restarted on failure. After 3 Quick failures/restarts it is not restarting anymore as expected. Now I expected the systemd to start the service after the timeout (StartLimitInterval). But the systemd is not automatically starting the service after the timeout(90sec), if I manually restart the service after the timeout it is working. But I want the systemd to automatically start the service after the StartLimitInterval. Please let me know on how to achieve this feature.










share|improve this question

















  • 3





    I wrote an article that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd.

    – Benjamin
    Sep 6 '17 at 12:05







  • 2





    I think you're looking for StartLimitIntervalSec, not StartLimitInterval.

    – Marc Tamsky
    Oct 24 '17 at 17:10













25












25








25


6






I want my systemd service to be automatically restarted on failure. Additionally I want to rate limit the restarts. I want to allow maximum of 3 restarts within 90 seconds duration. Hence I have done the following configuration.



[Service]

Restart=always

StartLimitInterval=90

StartLimitBurst=3



Now the service is restarted on failure. After 3 Quick failures/restarts it is not restarting anymore as expected. Now I expected the systemd to start the service after the timeout (StartLimitInterval). But the systemd is not automatically starting the service after the timeout(90sec), if I manually restart the service after the timeout it is working. But I want the systemd to automatically start the service after the StartLimitInterval. Please let me know on how to achieve this feature.










share|improve this question














I want my systemd service to be automatically restarted on failure. Additionally I want to rate limit the restarts. I want to allow maximum of 3 restarts within 90 seconds duration. Hence I have done the following configuration.



[Service]

Restart=always

StartLimitInterval=90

StartLimitBurst=3



Now the service is restarted on failure. After 3 Quick failures/restarts it is not restarting anymore as expected. Now I expected the systemd to start the service after the timeout (StartLimitInterval). But the systemd is not automatically starting the service after the timeout(90sec), if I manually restart the service after the timeout it is working. But I want the systemd to automatically start the service after the StartLimitInterval. Please let me know on how to achieve this feature.







systemd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '15 at 6:15









Dinesh P.R.Dinesh P.R.

226136




226136







  • 3





    I wrote an article that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd.

    – Benjamin
    Sep 6 '17 at 12:05







  • 2





    I think you're looking for StartLimitIntervalSec, not StartLimitInterval.

    – Marc Tamsky
    Oct 24 '17 at 17:10












  • 3





    I wrote an article that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd.

    – Benjamin
    Sep 6 '17 at 12:05







  • 2





    I think you're looking for StartLimitIntervalSec, not StartLimitInterval.

    – Marc Tamsky
    Oct 24 '17 at 17:10







3




3





I wrote an article that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd.

– Benjamin
Sep 6 '17 at 12:05






I wrote an article that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd.

– Benjamin
Sep 6 '17 at 12:05





2




2





I think you're looking for StartLimitIntervalSec, not StartLimitInterval.

– Marc Tamsky
Oct 24 '17 at 17:10





I think you're looking for StartLimitIntervalSec, not StartLimitInterval.

– Marc Tamsky
Oct 24 '17 at 17:10










4 Answers
4






active

oldest

votes


















24














To have a service restart 3 times at 90 second intervals include the following lines in your systemd service file:



Restart=always
RestartSec=90
StartLimitInterval=400
StartLimitBurst=3


This worked worked for me for a service that runs a script using 'Type=idle'. Note that 'StartLimitInterval' must be greater than 'RestartSec * StartLimitBurst' otherwise the service will be restarted indefinitely.



It took me some time with a lot of trial and error to work out how systemd uses these options, which suggests that systemd isn't as well documented as one would hope. These options effectively provide the retry cycle time and maximum retries that I was looking for.






share|improve this answer























  • This should be marked as accepted answer...

    – Jeff
    Nov 15 '18 at 16:22


















10














The behavior you describe is consistent with the documentation:



StartLimitInterval=, StartLimitBurst=
Configure service start rate limiting. By default, services which are started more than 5 times within 10 seconds are not permitted to start any more times until the 10 second interval ends. With these two options, this rate limiting may be modified. Use StartLimitInterval= to configure the checking interval (defaults to DefaultStartLimitInterval= in manager configuration file, set to 0 to disable any kind of rate limiting). Use StartLimitBurst= to configure how many starts per interval are allowed (defaults to DefaultStartLimitBurst= in manager configuration file). These configuration options are particularly useful in conjunction with Restart=; however, they apply to all kinds of starts (including manual), not just those triggered by the Restart= logic. Note that units which are configured for Restart= and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, from which point on, the restart logic is again activated. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a service and the start limit interferes with that.



I am still trying myself to figure out a way to accomplish the behavior you desire.






share|improve this answer

























  • This is more a comment than an answer as you point out.

    – Dave M
    Feb 2 '16 at 13:29











  • exactly what i needed, ty

    – Some Linux Nerd
    Nov 2 '17 at 18:35











  • According to the documentation you've linked, shouldn't it be StartLimitIntervalSec= (and DefaultStartLimitIntervalSec=)? Note the addition of Sec to both parameter names.

    – Doktor J
    Jan 15 at 21:06


















1














You can set OnFailure to start another service when this fails. In the on-fail service you can run a script that waits and then restarts your service.



For a sample on how to set this up see Systemd status mail on unit failure and modify it to restart the service instead.






share|improve this answer






























    0














    Some years later and with systemd 232 it dosn't work anymore as described in the question and in the answers from 2016. Option name StartLimitIntervalSec and Sections have changed. Now it has to look like this example:



    [Unit]
    StartLimitBurst=5
    StartLimitIntervalSec=33

    [Service]
    Restart=always
    RestartSec=5
    ExecStart=/bin/sleep 6


    This will do 5 restarts in 30 sec (5*6) plus one restart in 33 sec. So we have 6 restarts in 33 sec. This exceeds the limit of 5 restarts in 33 sec. So restarts will stop at 5 counts after about 31 sec.






    share|improve this answer








    New contributor




    Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "2"
      ;
      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',
      autoActivateHeartbeat: false,
      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%2fserverfault.com%2fquestions%2f736624%2fsystemd-service-automatic-restart-after-startlimitinterval%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      24














      To have a service restart 3 times at 90 second intervals include the following lines in your systemd service file:



      Restart=always
      RestartSec=90
      StartLimitInterval=400
      StartLimitBurst=3


      This worked worked for me for a service that runs a script using 'Type=idle'. Note that 'StartLimitInterval' must be greater than 'RestartSec * StartLimitBurst' otherwise the service will be restarted indefinitely.



      It took me some time with a lot of trial and error to work out how systemd uses these options, which suggests that systemd isn't as well documented as one would hope. These options effectively provide the retry cycle time and maximum retries that I was looking for.






      share|improve this answer























      • This should be marked as accepted answer...

        – Jeff
        Nov 15 '18 at 16:22















      24














      To have a service restart 3 times at 90 second intervals include the following lines in your systemd service file:



      Restart=always
      RestartSec=90
      StartLimitInterval=400
      StartLimitBurst=3


      This worked worked for me for a service that runs a script using 'Type=idle'. Note that 'StartLimitInterval' must be greater than 'RestartSec * StartLimitBurst' otherwise the service will be restarted indefinitely.



      It took me some time with a lot of trial and error to work out how systemd uses these options, which suggests that systemd isn't as well documented as one would hope. These options effectively provide the retry cycle time and maximum retries that I was looking for.






      share|improve this answer























      • This should be marked as accepted answer...

        – Jeff
        Nov 15 '18 at 16:22













      24












      24








      24







      To have a service restart 3 times at 90 second intervals include the following lines in your systemd service file:



      Restart=always
      RestartSec=90
      StartLimitInterval=400
      StartLimitBurst=3


      This worked worked for me for a service that runs a script using 'Type=idle'. Note that 'StartLimitInterval' must be greater than 'RestartSec * StartLimitBurst' otherwise the service will be restarted indefinitely.



      It took me some time with a lot of trial and error to work out how systemd uses these options, which suggests that systemd isn't as well documented as one would hope. These options effectively provide the retry cycle time and maximum retries that I was looking for.






      share|improve this answer













      To have a service restart 3 times at 90 second intervals include the following lines in your systemd service file:



      Restart=always
      RestartSec=90
      StartLimitInterval=400
      StartLimitBurst=3


      This worked worked for me for a service that runs a script using 'Type=idle'. Note that 'StartLimitInterval' must be greater than 'RestartSec * StartLimitBurst' otherwise the service will be restarted indefinitely.



      It took me some time with a lot of trial and error to work out how systemd uses these options, which suggests that systemd isn't as well documented as one would hope. These options effectively provide the retry cycle time and maximum retries that I was looking for.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Sep 2 '16 at 4:41









      jrossjross

      35922




      35922












      • This should be marked as accepted answer...

        – Jeff
        Nov 15 '18 at 16:22

















      • This should be marked as accepted answer...

        – Jeff
        Nov 15 '18 at 16:22
















      This should be marked as accepted answer...

      – Jeff
      Nov 15 '18 at 16:22





      This should be marked as accepted answer...

      – Jeff
      Nov 15 '18 at 16:22













      10














      The behavior you describe is consistent with the documentation:



      StartLimitInterval=, StartLimitBurst=
      Configure service start rate limiting. By default, services which are started more than 5 times within 10 seconds are not permitted to start any more times until the 10 second interval ends. With these two options, this rate limiting may be modified. Use StartLimitInterval= to configure the checking interval (defaults to DefaultStartLimitInterval= in manager configuration file, set to 0 to disable any kind of rate limiting). Use StartLimitBurst= to configure how many starts per interval are allowed (defaults to DefaultStartLimitBurst= in manager configuration file). These configuration options are particularly useful in conjunction with Restart=; however, they apply to all kinds of starts (including manual), not just those triggered by the Restart= logic. Note that units which are configured for Restart= and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, from which point on, the restart logic is again activated. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a service and the start limit interferes with that.



      I am still trying myself to figure out a way to accomplish the behavior you desire.






      share|improve this answer

























      • This is more a comment than an answer as you point out.

        – Dave M
        Feb 2 '16 at 13:29











      • exactly what i needed, ty

        – Some Linux Nerd
        Nov 2 '17 at 18:35











      • According to the documentation you've linked, shouldn't it be StartLimitIntervalSec= (and DefaultStartLimitIntervalSec=)? Note the addition of Sec to both parameter names.

        – Doktor J
        Jan 15 at 21:06















      10














      The behavior you describe is consistent with the documentation:



      StartLimitInterval=, StartLimitBurst=
      Configure service start rate limiting. By default, services which are started more than 5 times within 10 seconds are not permitted to start any more times until the 10 second interval ends. With these two options, this rate limiting may be modified. Use StartLimitInterval= to configure the checking interval (defaults to DefaultStartLimitInterval= in manager configuration file, set to 0 to disable any kind of rate limiting). Use StartLimitBurst= to configure how many starts per interval are allowed (defaults to DefaultStartLimitBurst= in manager configuration file). These configuration options are particularly useful in conjunction with Restart=; however, they apply to all kinds of starts (including manual), not just those triggered by the Restart= logic. Note that units which are configured for Restart= and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, from which point on, the restart logic is again activated. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a service and the start limit interferes with that.



      I am still trying myself to figure out a way to accomplish the behavior you desire.






      share|improve this answer

























      • This is more a comment than an answer as you point out.

        – Dave M
        Feb 2 '16 at 13:29











      • exactly what i needed, ty

        – Some Linux Nerd
        Nov 2 '17 at 18:35











      • According to the documentation you've linked, shouldn't it be StartLimitIntervalSec= (and DefaultStartLimitIntervalSec=)? Note the addition of Sec to both parameter names.

        – Doktor J
        Jan 15 at 21:06













      10












      10








      10







      The behavior you describe is consistent with the documentation:



      StartLimitInterval=, StartLimitBurst=
      Configure service start rate limiting. By default, services which are started more than 5 times within 10 seconds are not permitted to start any more times until the 10 second interval ends. With these two options, this rate limiting may be modified. Use StartLimitInterval= to configure the checking interval (defaults to DefaultStartLimitInterval= in manager configuration file, set to 0 to disable any kind of rate limiting). Use StartLimitBurst= to configure how many starts per interval are allowed (defaults to DefaultStartLimitBurst= in manager configuration file). These configuration options are particularly useful in conjunction with Restart=; however, they apply to all kinds of starts (including manual), not just those triggered by the Restart= logic. Note that units which are configured for Restart= and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, from which point on, the restart logic is again activated. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a service and the start limit interferes with that.



      I am still trying myself to figure out a way to accomplish the behavior you desire.






      share|improve this answer















      The behavior you describe is consistent with the documentation:



      StartLimitInterval=, StartLimitBurst=
      Configure service start rate limiting. By default, services which are started more than 5 times within 10 seconds are not permitted to start any more times until the 10 second interval ends. With these two options, this rate limiting may be modified. Use StartLimitInterval= to configure the checking interval (defaults to DefaultStartLimitInterval= in manager configuration file, set to 0 to disable any kind of rate limiting). Use StartLimitBurst= to configure how many starts per interval are allowed (defaults to DefaultStartLimitBurst= in manager configuration file). These configuration options are particularly useful in conjunction with Restart=; however, they apply to all kinds of starts (including manual), not just those triggered by the Restart= logic. Note that units which are configured for Restart= and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually at a later point, from which point on, the restart logic is again activated. Note that systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a service and the start limit interferes with that.



      I am still trying myself to figure out a way to accomplish the behavior you desire.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 10 '17 at 13:24









      guettli

      33832658




      33832658










      answered Feb 2 '16 at 12:16









      Youssef EldakarYoussef Eldakar

      12114




      12114












      • This is more a comment than an answer as you point out.

        – Dave M
        Feb 2 '16 at 13:29











      • exactly what i needed, ty

        – Some Linux Nerd
        Nov 2 '17 at 18:35











      • According to the documentation you've linked, shouldn't it be StartLimitIntervalSec= (and DefaultStartLimitIntervalSec=)? Note the addition of Sec to both parameter names.

        – Doktor J
        Jan 15 at 21:06

















      • This is more a comment than an answer as you point out.

        – Dave M
        Feb 2 '16 at 13:29











      • exactly what i needed, ty

        – Some Linux Nerd
        Nov 2 '17 at 18:35











      • According to the documentation you've linked, shouldn't it be StartLimitIntervalSec= (and DefaultStartLimitIntervalSec=)? Note the addition of Sec to both parameter names.

        – Doktor J
        Jan 15 at 21:06
















      This is more a comment than an answer as you point out.

      – Dave M
      Feb 2 '16 at 13:29





      This is more a comment than an answer as you point out.

      – Dave M
      Feb 2 '16 at 13:29













      exactly what i needed, ty

      – Some Linux Nerd
      Nov 2 '17 at 18:35





      exactly what i needed, ty

      – Some Linux Nerd
      Nov 2 '17 at 18:35













      According to the documentation you've linked, shouldn't it be StartLimitIntervalSec= (and DefaultStartLimitIntervalSec=)? Note the addition of Sec to both parameter names.

      – Doktor J
      Jan 15 at 21:06





      According to the documentation you've linked, shouldn't it be StartLimitIntervalSec= (and DefaultStartLimitIntervalSec=)? Note the addition of Sec to both parameter names.

      – Doktor J
      Jan 15 at 21:06











      1














      You can set OnFailure to start another service when this fails. In the on-fail service you can run a script that waits and then restarts your service.



      For a sample on how to set this up see Systemd status mail on unit failure and modify it to restart the service instead.






      share|improve this answer



























        1














        You can set OnFailure to start another service when this fails. In the on-fail service you can run a script that waits and then restarts your service.



        For a sample on how to set this up see Systemd status mail on unit failure and modify it to restart the service instead.






        share|improve this answer

























          1












          1








          1







          You can set OnFailure to start another service when this fails. In the on-fail service you can run a script that waits and then restarts your service.



          For a sample on how to set this up see Systemd status mail on unit failure and modify it to restart the service instead.






          share|improve this answer













          You can set OnFailure to start another service when this fails. In the on-fail service you can run a script that waits and then restarts your service.



          For a sample on how to set this up see Systemd status mail on unit failure and modify it to restart the service instead.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 13 '16 at 8:43









          laktaklaktak

          372716




          372716





















              0














              Some years later and with systemd 232 it dosn't work anymore as described in the question and in the answers from 2016. Option name StartLimitIntervalSec and Sections have changed. Now it has to look like this example:



              [Unit]
              StartLimitBurst=5
              StartLimitIntervalSec=33

              [Service]
              Restart=always
              RestartSec=5
              ExecStart=/bin/sleep 6


              This will do 5 restarts in 30 sec (5*6) plus one restart in 33 sec. So we have 6 restarts in 33 sec. This exceeds the limit of 5 restarts in 33 sec. So restarts will stop at 5 counts after about 31 sec.






              share|improve this answer








              New contributor




              Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.
























                0














                Some years later and with systemd 232 it dosn't work anymore as described in the question and in the answers from 2016. Option name StartLimitIntervalSec and Sections have changed. Now it has to look like this example:



                [Unit]
                StartLimitBurst=5
                StartLimitIntervalSec=33

                [Service]
                Restart=always
                RestartSec=5
                ExecStart=/bin/sleep 6


                This will do 5 restarts in 30 sec (5*6) plus one restart in 33 sec. So we have 6 restarts in 33 sec. This exceeds the limit of 5 restarts in 33 sec. So restarts will stop at 5 counts after about 31 sec.






                share|improve this answer








                New contributor




                Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






















                  0












                  0








                  0







                  Some years later and with systemd 232 it dosn't work anymore as described in the question and in the answers from 2016. Option name StartLimitIntervalSec and Sections have changed. Now it has to look like this example:



                  [Unit]
                  StartLimitBurst=5
                  StartLimitIntervalSec=33

                  [Service]
                  Restart=always
                  RestartSec=5
                  ExecStart=/bin/sleep 6


                  This will do 5 restarts in 30 sec (5*6) plus one restart in 33 sec. So we have 6 restarts in 33 sec. This exceeds the limit of 5 restarts in 33 sec. So restarts will stop at 5 counts after about 31 sec.






                  share|improve this answer








                  New contributor




                  Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  Some years later and with systemd 232 it dosn't work anymore as described in the question and in the answers from 2016. Option name StartLimitIntervalSec and Sections have changed. Now it has to look like this example:



                  [Unit]
                  StartLimitBurst=5
                  StartLimitIntervalSec=33

                  [Service]
                  Restart=always
                  RestartSec=5
                  ExecStart=/bin/sleep 6


                  This will do 5 restarts in 30 sec (5*6) plus one restart in 33 sec. So we have 6 restarts in 33 sec. This exceeds the limit of 5 restarts in 33 sec. So restarts will stop at 5 counts after about 31 sec.







                  share|improve this answer








                  New contributor




                  Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 13 hours ago









                  IngoIngo

                  1013




                  1013




                  New contributor




                  Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Ingo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Server Fault!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f736624%2fsystemd-service-automatic-restart-after-startlimitinterval%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 to make RAID controller rescan devices The 2019 Stack Overflow Developer Survey Results Are InLSI MegaRAID SAS 9261-8i: Disk isn't recognized after replacementHow to monitor the hard disk status behind Dell PERC H710 Raid Controller with CentOS 6?LSI MegaRAID - Recreate missing RAID 1 arrayext. 2-bay USB-Drive with RAID: btrfs RAID vs built-in RAIDInvalid SAS topologyDoes enabling JBOD mode on LSI based controllers affect existing logical disks/arrays?Why is there a shift between the WWN reported from the controller and the Linux system?Optimal RAID 6+0 Setup for 40+ 4TB DisksAccidental SAS cable removal

                      Unbreakable Formation vs. Cry of the Carnarium The 2019 Stack Overflow Developer Survey Results Are InCan an indestructible creature die by a combination of damage and -X/-X effects?Can a non-instant or sorcery ever have flashback?do creatures created after a “all creatures get -1/-1 until end of turn” instant get -1/-1 as well?What happens when I target an indestructible card with an “if that would die this turn, exile it instead” effect?Exalted trigger timingWhat happens when a non-token creature loses all abilities, is exiled, then returns?Does the spell cast with Yahenni's Expertise resolve before state-based effects are checked?What happens if Always Watching is destroyed mid-combat?MTG: Abilities lost when exiled?Under which controller does a stolen permanent come into play after being exiled?

                      Polarna površina molekula Vidi još Reference Spoljašnje veze Мени за навигацију10.1021/jm000942ePolar Surface AreaInteractive Polar Surface Area calculatorFree, Programmable TPSA Calculator