Supervisord removing a process after successfully running

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have the following configuration for a process to run continuously. Apparently, it works very fine but after few hours or sometimes few minutes, the process gets terminated.



Any kind of help is highly appreciated.



Supervisord Config:



[program:action_consumer]
process_name=%(program_name)s_%(process_num)02d
command = php /var/www/the_api/web/index.php actionCron
numprocs = 2
autostart=true
autorestart=true
user=console_api
redirect_stderr=true
stdout_logfile=/var/www/the_api/logs/action_consumer.log
RestartSec=3
Restart=3
WatchdogSec=3


OS Info:



Debian GNU/Linux 8 (jessie)



Log file:
The log file contains the following error:



FATAL state, too many start retries too quickly


Important:



It is obvious that the process terminates too quickly, it is my requirement. I don't want to run the script in an infinite loop. Is setting startretries a valid solution?







share|improve this question






















  • Check logs in /var/www/the_api/logs/action_consumer.log file. You might get better idea. If you are not able to understand the logs, Please edit your question and post it in same.
    – Nitesh B.
    Apr 3 at 10:15











  • The error log just contains the output i have printed on the script using echo. Nothing else. @Nitesh
    – Jason Kruger
    Apr 6 at 7:29










  • If your service is getting terminated, logs must be getting generated somewhere. How about system logs ? Did you check the system logs ?
    – Nitesh B.
    Apr 6 at 7:54











  • I managed to print supervisor.log and it contains this error: FATAL state, too many start retries too quickly
    – Jason Kruger
    Apr 6 at 8:02










  • So as per your updated question, yes, you can use startretries option.
    – Nitesh B.
    Apr 6 at 8:09














up vote
0
down vote

favorite












I have the following configuration for a process to run continuously. Apparently, it works very fine but after few hours or sometimes few minutes, the process gets terminated.



Any kind of help is highly appreciated.



Supervisord Config:



[program:action_consumer]
process_name=%(program_name)s_%(process_num)02d
command = php /var/www/the_api/web/index.php actionCron
numprocs = 2
autostart=true
autorestart=true
user=console_api
redirect_stderr=true
stdout_logfile=/var/www/the_api/logs/action_consumer.log
RestartSec=3
Restart=3
WatchdogSec=3


OS Info:



Debian GNU/Linux 8 (jessie)



Log file:
The log file contains the following error:



FATAL state, too many start retries too quickly


Important:



It is obvious that the process terminates too quickly, it is my requirement. I don't want to run the script in an infinite loop. Is setting startretries a valid solution?







share|improve this question






















  • Check logs in /var/www/the_api/logs/action_consumer.log file. You might get better idea. If you are not able to understand the logs, Please edit your question and post it in same.
    – Nitesh B.
    Apr 3 at 10:15











  • The error log just contains the output i have printed on the script using echo. Nothing else. @Nitesh
    – Jason Kruger
    Apr 6 at 7:29










  • If your service is getting terminated, logs must be getting generated somewhere. How about system logs ? Did you check the system logs ?
    – Nitesh B.
    Apr 6 at 7:54











  • I managed to print supervisor.log and it contains this error: FATAL state, too many start retries too quickly
    – Jason Kruger
    Apr 6 at 8:02










  • So as per your updated question, yes, you can use startretries option.
    – Nitesh B.
    Apr 6 at 8:09












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have the following configuration for a process to run continuously. Apparently, it works very fine but after few hours or sometimes few minutes, the process gets terminated.



Any kind of help is highly appreciated.



Supervisord Config:



[program:action_consumer]
process_name=%(program_name)s_%(process_num)02d
command = php /var/www/the_api/web/index.php actionCron
numprocs = 2
autostart=true
autorestart=true
user=console_api
redirect_stderr=true
stdout_logfile=/var/www/the_api/logs/action_consumer.log
RestartSec=3
Restart=3
WatchdogSec=3


OS Info:



Debian GNU/Linux 8 (jessie)



Log file:
The log file contains the following error:



FATAL state, too many start retries too quickly


Important:



It is obvious that the process terminates too quickly, it is my requirement. I don't want to run the script in an infinite loop. Is setting startretries a valid solution?







share|improve this question














I have the following configuration for a process to run continuously. Apparently, it works very fine but after few hours or sometimes few minutes, the process gets terminated.



Any kind of help is highly appreciated.



Supervisord Config:



[program:action_consumer]
process_name=%(program_name)s_%(process_num)02d
command = php /var/www/the_api/web/index.php actionCron
numprocs = 2
autostart=true
autorestart=true
user=console_api
redirect_stderr=true
stdout_logfile=/var/www/the_api/logs/action_consumer.log
RestartSec=3
Restart=3
WatchdogSec=3


OS Info:



Debian GNU/Linux 8 (jessie)



Log file:
The log file contains the following error:



FATAL state, too many start retries too quickly


Important:



It is obvious that the process terminates too quickly, it is my requirement. I don't want to run the script in an infinite loop. Is setting startretries a valid solution?









share|improve this question













share|improve this question




share|improve this question








edited Apr 6 at 8:05

























asked Apr 3 at 6:37









Jason Kruger

11




11











  • Check logs in /var/www/the_api/logs/action_consumer.log file. You might get better idea. If you are not able to understand the logs, Please edit your question and post it in same.
    – Nitesh B.
    Apr 3 at 10:15











  • The error log just contains the output i have printed on the script using echo. Nothing else. @Nitesh
    – Jason Kruger
    Apr 6 at 7:29










  • If your service is getting terminated, logs must be getting generated somewhere. How about system logs ? Did you check the system logs ?
    – Nitesh B.
    Apr 6 at 7:54











  • I managed to print supervisor.log and it contains this error: FATAL state, too many start retries too quickly
    – Jason Kruger
    Apr 6 at 8:02










  • So as per your updated question, yes, you can use startretries option.
    – Nitesh B.
    Apr 6 at 8:09
















  • Check logs in /var/www/the_api/logs/action_consumer.log file. You might get better idea. If you are not able to understand the logs, Please edit your question and post it in same.
    – Nitesh B.
    Apr 3 at 10:15











  • The error log just contains the output i have printed on the script using echo. Nothing else. @Nitesh
    – Jason Kruger
    Apr 6 at 7:29










  • If your service is getting terminated, logs must be getting generated somewhere. How about system logs ? Did you check the system logs ?
    – Nitesh B.
    Apr 6 at 7:54











  • I managed to print supervisor.log and it contains this error: FATAL state, too many start retries too quickly
    – Jason Kruger
    Apr 6 at 8:02










  • So as per your updated question, yes, you can use startretries option.
    – Nitesh B.
    Apr 6 at 8:09















Check logs in /var/www/the_api/logs/action_consumer.log file. You might get better idea. If you are not able to understand the logs, Please edit your question and post it in same.
– Nitesh B.
Apr 3 at 10:15





Check logs in /var/www/the_api/logs/action_consumer.log file. You might get better idea. If you are not able to understand the logs, Please edit your question and post it in same.
– Nitesh B.
Apr 3 at 10:15













The error log just contains the output i have printed on the script using echo. Nothing else. @Nitesh
– Jason Kruger
Apr 6 at 7:29




The error log just contains the output i have printed on the script using echo. Nothing else. @Nitesh
– Jason Kruger
Apr 6 at 7:29












If your service is getting terminated, logs must be getting generated somewhere. How about system logs ? Did you check the system logs ?
– Nitesh B.
Apr 6 at 7:54





If your service is getting terminated, logs must be getting generated somewhere. How about system logs ? Did you check the system logs ?
– Nitesh B.
Apr 6 at 7:54













I managed to print supervisor.log and it contains this error: FATAL state, too many start retries too quickly
– Jason Kruger
Apr 6 at 8:02




I managed to print supervisor.log and it contains this error: FATAL state, too many start retries too quickly
– Jason Kruger
Apr 6 at 8:02












So as per your updated question, yes, you can use startretries option.
– Nitesh B.
Apr 6 at 8:09




So as per your updated question, yes, you can use startretries option.
– Nitesh B.
Apr 6 at 8:09










2 Answers
2






active

oldest

votes

















up vote
0
down vote













In case the time frame for the race condition was less than a second so setting startretries=<number you want>. However you can set it to a much higher value if need be. Below is an example.



[program:test]
startretries=10





share|improve this answer




















  • So supervisord will try to restart the script 10 times in a second? Can you explain this?
    – Jason Kruger
    Apr 6 at 8:15











  • No, not 10 times in a second. The number explains that supervisord will attempting to start the program before giving up and putting the process into an FATAL state. you can find more example "supervisord.org/…;
    – Nitesh B.
    Apr 6 at 9:44











  • How can be the startretries unlimited?
    – Jason Kruger
    Apr 9 at 14:39

















up vote
0
down vote













Since the issue was of 0 second execution time. Most of the time the scripts executes within 0 seconds, so supervisor terminates it.
I resolved this issue by adding startsecs=0.






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435211%2fsupervisord-removing-a-process-after-successfully-running%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    In case the time frame for the race condition was less than a second so setting startretries=<number you want>. However you can set it to a much higher value if need be. Below is an example.



    [program:test]
    startretries=10





    share|improve this answer




















    • So supervisord will try to restart the script 10 times in a second? Can you explain this?
      – Jason Kruger
      Apr 6 at 8:15











    • No, not 10 times in a second. The number explains that supervisord will attempting to start the program before giving up and putting the process into an FATAL state. you can find more example "supervisord.org/…;
      – Nitesh B.
      Apr 6 at 9:44











    • How can be the startretries unlimited?
      – Jason Kruger
      Apr 9 at 14:39














    up vote
    0
    down vote













    In case the time frame for the race condition was less than a second so setting startretries=<number you want>. However you can set it to a much higher value if need be. Below is an example.



    [program:test]
    startretries=10





    share|improve this answer




















    • So supervisord will try to restart the script 10 times in a second? Can you explain this?
      – Jason Kruger
      Apr 6 at 8:15











    • No, not 10 times in a second. The number explains that supervisord will attempting to start the program before giving up and putting the process into an FATAL state. you can find more example "supervisord.org/…;
      – Nitesh B.
      Apr 6 at 9:44











    • How can be the startretries unlimited?
      – Jason Kruger
      Apr 9 at 14:39












    up vote
    0
    down vote










    up vote
    0
    down vote









    In case the time frame for the race condition was less than a second so setting startretries=<number you want>. However you can set it to a much higher value if need be. Below is an example.



    [program:test]
    startretries=10





    share|improve this answer












    In case the time frame for the race condition was less than a second so setting startretries=<number you want>. However you can set it to a much higher value if need be. Below is an example.



    [program:test]
    startretries=10






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 6 at 8:11









    Nitesh B.

    3711417




    3711417











    • So supervisord will try to restart the script 10 times in a second? Can you explain this?
      – Jason Kruger
      Apr 6 at 8:15











    • No, not 10 times in a second. The number explains that supervisord will attempting to start the program before giving up and putting the process into an FATAL state. you can find more example "supervisord.org/…;
      – Nitesh B.
      Apr 6 at 9:44











    • How can be the startretries unlimited?
      – Jason Kruger
      Apr 9 at 14:39
















    • So supervisord will try to restart the script 10 times in a second? Can you explain this?
      – Jason Kruger
      Apr 6 at 8:15











    • No, not 10 times in a second. The number explains that supervisord will attempting to start the program before giving up and putting the process into an FATAL state. you can find more example "supervisord.org/…;
      – Nitesh B.
      Apr 6 at 9:44











    • How can be the startretries unlimited?
      – Jason Kruger
      Apr 9 at 14:39















    So supervisord will try to restart the script 10 times in a second? Can you explain this?
    – Jason Kruger
    Apr 6 at 8:15





    So supervisord will try to restart the script 10 times in a second? Can you explain this?
    – Jason Kruger
    Apr 6 at 8:15













    No, not 10 times in a second. The number explains that supervisord will attempting to start the program before giving up and putting the process into an FATAL state. you can find more example "supervisord.org/…;
    – Nitesh B.
    Apr 6 at 9:44





    No, not 10 times in a second. The number explains that supervisord will attempting to start the program before giving up and putting the process into an FATAL state. you can find more example "supervisord.org/…;
    – Nitesh B.
    Apr 6 at 9:44













    How can be the startretries unlimited?
    – Jason Kruger
    Apr 9 at 14:39




    How can be the startretries unlimited?
    – Jason Kruger
    Apr 9 at 14:39












    up vote
    0
    down vote













    Since the issue was of 0 second execution time. Most of the time the scripts executes within 0 seconds, so supervisor terminates it.
    I resolved this issue by adding startsecs=0.






    share|improve this answer


























      up vote
      0
      down vote













      Since the issue was of 0 second execution time. Most of the time the scripts executes within 0 seconds, so supervisor terminates it.
      I resolved this issue by adding startsecs=0.






      share|improve this answer
























        up vote
        0
        down vote










        up vote
        0
        down vote









        Since the issue was of 0 second execution time. Most of the time the scripts executes within 0 seconds, so supervisor terminates it.
        I resolved this issue by adding startsecs=0.






        share|improve this answer














        Since the issue was of 0 second execution time. Most of the time the scripts executes within 0 seconds, so supervisor terminates it.
        I resolved this issue by adding startsecs=0.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 17 at 12:18









        Jeff Schaller

        31.1k846105




        31.1k846105










        answered May 17 at 11:23









        Jason Kruger

        11




        11






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435211%2fsupervisord-removing-a-process-after-successfully-running%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)