Delay a respawn of a service

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











up vote
0
down vote

favorite












How can I delay the start of my service using respawn?



I am configuring my service in inittab like this:



vpn:2345:respawn:/etc/init.d/openvpn restart


and I am getting respawn too fast error and the service is disabled for 5 minutes.
how can I make respawn wait some time before trying to restart the service?



I am running a custom distribution of linux for ARM architecture (debian packages for ARM can be installed in this distribution)
linux kernel is : linux-3.10.x



Thanks!










share|improve this question























  • Don't run it from init, rather install something like DJB's daemontools.
    – Satō Katsura
    Sep 25 '17 at 17:09










  • make a cron job for stopping and another for starting it at another time
    – Joe
    Sep 25 '17 at 17:18










  • You already asked this at unix.stackexchange.com/questions/394332 .
    – JdeBP
    Sep 25 '17 at 17:55










  • The init.d scripts return very quickly. They don't work well in an inittab respawn entry. The regular init system ought to be able to handle what you want. What Linux or Unix distribution and version number are you running?
    – Mark Plotnick
    Sep 25 '17 at 18:32











  • @JdeBP No, she didn't.
    – Hauke Laging
    Sep 25 '17 at 18:53














up vote
0
down vote

favorite












How can I delay the start of my service using respawn?



I am configuring my service in inittab like this:



vpn:2345:respawn:/etc/init.d/openvpn restart


and I am getting respawn too fast error and the service is disabled for 5 minutes.
how can I make respawn wait some time before trying to restart the service?



I am running a custom distribution of linux for ARM architecture (debian packages for ARM can be installed in this distribution)
linux kernel is : linux-3.10.x



Thanks!










share|improve this question























  • Don't run it from init, rather install something like DJB's daemontools.
    – Satō Katsura
    Sep 25 '17 at 17:09










  • make a cron job for stopping and another for starting it at another time
    – Joe
    Sep 25 '17 at 17:18










  • You already asked this at unix.stackexchange.com/questions/394332 .
    – JdeBP
    Sep 25 '17 at 17:55










  • The init.d scripts return very quickly. They don't work well in an inittab respawn entry. The regular init system ought to be able to handle what you want. What Linux or Unix distribution and version number are you running?
    – Mark Plotnick
    Sep 25 '17 at 18:32











  • @JdeBP No, she didn't.
    – Hauke Laging
    Sep 25 '17 at 18:53












up vote
0
down vote

favorite









up vote
0
down vote

favorite











How can I delay the start of my service using respawn?



I am configuring my service in inittab like this:



vpn:2345:respawn:/etc/init.d/openvpn restart


and I am getting respawn too fast error and the service is disabled for 5 minutes.
how can I make respawn wait some time before trying to restart the service?



I am running a custom distribution of linux for ARM architecture (debian packages for ARM can be installed in this distribution)
linux kernel is : linux-3.10.x



Thanks!










share|improve this question















How can I delay the start of my service using respawn?



I am configuring my service in inittab like this:



vpn:2345:respawn:/etc/init.d/openvpn restart


and I am getting respawn too fast error and the service is disabled for 5 minutes.
how can I make respawn wait some time before trying to restart the service?



I am running a custom distribution of linux for ARM architecture (debian packages for ARM can be installed in this distribution)
linux kernel is : linux-3.10.x



Thanks!







services sysvinit






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 26 '17 at 7:02

























asked Sep 25 '17 at 17:07









sabrina2020

10417




10417











  • Don't run it from init, rather install something like DJB's daemontools.
    – Satō Katsura
    Sep 25 '17 at 17:09










  • make a cron job for stopping and another for starting it at another time
    – Joe
    Sep 25 '17 at 17:18










  • You already asked this at unix.stackexchange.com/questions/394332 .
    – JdeBP
    Sep 25 '17 at 17:55










  • The init.d scripts return very quickly. They don't work well in an inittab respawn entry. The regular init system ought to be able to handle what you want. What Linux or Unix distribution and version number are you running?
    – Mark Plotnick
    Sep 25 '17 at 18:32











  • @JdeBP No, she didn't.
    – Hauke Laging
    Sep 25 '17 at 18:53
















  • Don't run it from init, rather install something like DJB's daemontools.
    – Satō Katsura
    Sep 25 '17 at 17:09










  • make a cron job for stopping and another for starting it at another time
    – Joe
    Sep 25 '17 at 17:18










  • You already asked this at unix.stackexchange.com/questions/394332 .
    – JdeBP
    Sep 25 '17 at 17:55










  • The init.d scripts return very quickly. They don't work well in an inittab respawn entry. The regular init system ought to be able to handle what you want. What Linux or Unix distribution and version number are you running?
    – Mark Plotnick
    Sep 25 '17 at 18:32











  • @JdeBP No, she didn't.
    – Hauke Laging
    Sep 25 '17 at 18:53















Don't run it from init, rather install something like DJB's daemontools.
– Satō Katsura
Sep 25 '17 at 17:09




Don't run it from init, rather install something like DJB's daemontools.
– Satō Katsura
Sep 25 '17 at 17:09












make a cron job for stopping and another for starting it at another time
– Joe
Sep 25 '17 at 17:18




make a cron job for stopping and another for starting it at another time
– Joe
Sep 25 '17 at 17:18












You already asked this at unix.stackexchange.com/questions/394332 .
– JdeBP
Sep 25 '17 at 17:55




You already asked this at unix.stackexchange.com/questions/394332 .
– JdeBP
Sep 25 '17 at 17:55












The init.d scripts return very quickly. They don't work well in an inittab respawn entry. The regular init system ought to be able to handle what you want. What Linux or Unix distribution and version number are you running?
– Mark Plotnick
Sep 25 '17 at 18:32





The init.d scripts return very quickly. They don't work well in an inittab respawn entry. The regular init system ought to be able to handle what you want. What Linux or Unix distribution and version number are you running?
– Mark Plotnick
Sep 25 '17 at 18:32













@JdeBP No, she didn't.
– Hauke Laging
Sep 25 '17 at 18:53




@JdeBP No, she didn't.
– Hauke Laging
Sep 25 '17 at 18:53










1 Answer
1






active

oldest

votes

















up vote
-1
down vote













If a service crashes on restart then it is not going to work if you delay its restart. But you can do that by putting a wrapper script in inittab that looks like this:



#! /bin/bash
sleep 60
exec /path/to/service





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%2f394357%2fdelay-a-respawn-of-a-service%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    -1
    down vote













    If a service crashes on restart then it is not going to work if you delay its restart. But you can do that by putting a wrapper script in inittab that looks like this:



    #! /bin/bash
    sleep 60
    exec /path/to/service





    share|improve this answer
























      up vote
      -1
      down vote













      If a service crashes on restart then it is not going to work if you delay its restart. But you can do that by putting a wrapper script in inittab that looks like this:



      #! /bin/bash
      sleep 60
      exec /path/to/service





      share|improve this answer






















        up vote
        -1
        down vote










        up vote
        -1
        down vote









        If a service crashes on restart then it is not going to work if you delay its restart. But you can do that by putting a wrapper script in inittab that looks like this:



        #! /bin/bash
        sleep 60
        exec /path/to/service





        share|improve this answer












        If a service crashes on restart then it is not going to work if you delay its restart. But you can do that by putting a wrapper script in inittab that looks like this:



        #! /bin/bash
        sleep 60
        exec /path/to/service






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 25 '17 at 18:57









        Hauke Laging

        53.7k1282130




        53.7k1282130



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394357%2fdelay-a-respawn-of-a-service%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?