Upstart - How to run cmd or script instead of respawnRunning Django sites through UpstartHow can I ensure a...

Term for the "extreme-extension" version of a straw man fallacy?

Avoiding estate tax by giving multiple gifts

How can a function with a hole (removable discontinuity) equal a function with no hole?

Why Were Madagascar and New Zealand Discovered So Late?

Balance Issues for a Custom Sorcerer Variant

Fastening aluminum fascia to wooden subfascia

Is exact Kanji stroke length important?

What is the difference between "behavior" and "behaviour"?

How does Loki do this?

Why not increase contact surface when reentering the atmosphere?

Are student evaluations of teaching assistants read by others in the faculty?

Is the destination of a commercial flight important for the pilot?

How do I go from 300 unfinished/half written blog posts, to published posts?

How does buying out courses with grant money work?

Do all network devices need to make routing decisions, regardless of communication across networks or within a network?

Integer addition + constant, is it a group?

Tiptoe or tiphoof? Adjusting words to better fit fantasy races

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

Risk of infection at the gym?

What happens if you roll doubles 3 times then land on "Go to jail?"

Large drywall patch supports

What is the best translation for "slot" in the context of multiplayer video games?

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

Class Action - which options I have?



Upstart - How to run cmd or script instead of respawn


Running Django sites through UpstartHow can I ensure a script gets executed after a service is stopped but before another service is stopped?Environment variable not being picked up by app when started with Upstart (Ubuntu)Ubuntu upstart script for tracd hangs on start/stopAmazon EC2 Ubuntu and upstart logging permissionsUpstart can't stop foreverjs services on shutdown?Upstart is not sending CONT to my stopped daemon which is configured to use 'expect stop'service in vagrant VM not picking up configurationSimplest infinite script exec without upstartrunning composer from upstart













0















I have a service process monitored by Upstart on Ubuntu.



If that process dies abnormally, I don't want to try to respawn it. Instead, I would like to throw a notification and shut down the entire instance for disposal, which I would probably do by running a shell command or script.



What is the best way to have Upstart do something other than respawning when a process dies?










share|improve this question























  • Closest I've found so far is the assertion that "When a service crashes, upstart will execute the post-stop script, but not the pre-stop script. We can use this to detect a crash." blog.gitter.im/2014/02/12/monitoring-upstart-processes

    – kbluck
    Sep 28 '18 at 21:31











  • Do you need to use an EOL or nearly EOL version of Ubuntu? Current versions of Ubuntu use systemd instead of upstart, and this would be pretty easy with systemd.

    – Michael Hampton
    Sep 29 '18 at 1:07


















0















I have a service process monitored by Upstart on Ubuntu.



If that process dies abnormally, I don't want to try to respawn it. Instead, I would like to throw a notification and shut down the entire instance for disposal, which I would probably do by running a shell command or script.



What is the best way to have Upstart do something other than respawning when a process dies?










share|improve this question























  • Closest I've found so far is the assertion that "When a service crashes, upstart will execute the post-stop script, but not the pre-stop script. We can use this to detect a crash." blog.gitter.im/2014/02/12/monitoring-upstart-processes

    – kbluck
    Sep 28 '18 at 21:31











  • Do you need to use an EOL or nearly EOL version of Ubuntu? Current versions of Ubuntu use systemd instead of upstart, and this would be pretty easy with systemd.

    – Michael Hampton
    Sep 29 '18 at 1:07
















0












0








0








I have a service process monitored by Upstart on Ubuntu.



If that process dies abnormally, I don't want to try to respawn it. Instead, I would like to throw a notification and shut down the entire instance for disposal, which I would probably do by running a shell command or script.



What is the best way to have Upstart do something other than respawning when a process dies?










share|improve this question














I have a service process monitored by Upstart on Ubuntu.



If that process dies abnormally, I don't want to try to respawn it. Instead, I would like to throw a notification and shut down the entire instance for disposal, which I would probably do by running a shell command or script.



What is the best way to have Upstart do something other than respawning when a process dies?







upstart






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 28 '18 at 21:12









kbluckkbluck

160127




160127













  • Closest I've found so far is the assertion that "When a service crashes, upstart will execute the post-stop script, but not the pre-stop script. We can use this to detect a crash." blog.gitter.im/2014/02/12/monitoring-upstart-processes

    – kbluck
    Sep 28 '18 at 21:31











  • Do you need to use an EOL or nearly EOL version of Ubuntu? Current versions of Ubuntu use systemd instead of upstart, and this would be pretty easy with systemd.

    – Michael Hampton
    Sep 29 '18 at 1:07





















  • Closest I've found so far is the assertion that "When a service crashes, upstart will execute the post-stop script, but not the pre-stop script. We can use this to detect a crash." blog.gitter.im/2014/02/12/monitoring-upstart-processes

    – kbluck
    Sep 28 '18 at 21:31











  • Do you need to use an EOL or nearly EOL version of Ubuntu? Current versions of Ubuntu use systemd instead of upstart, and this would be pretty easy with systemd.

    – Michael Hampton
    Sep 29 '18 at 1:07



















Closest I've found so far is the assertion that "When a service crashes, upstart will execute the post-stop script, but not the pre-stop script. We can use this to detect a crash." blog.gitter.im/2014/02/12/monitoring-upstart-processes

– kbluck
Sep 28 '18 at 21:31





Closest I've found so far is the assertion that "When a service crashes, upstart will execute the post-stop script, but not the pre-stop script. We can use this to detect a crash." blog.gitter.im/2014/02/12/monitoring-upstart-processes

– kbluck
Sep 28 '18 at 21:31













Do you need to use an EOL or nearly EOL version of Ubuntu? Current versions of Ubuntu use systemd instead of upstart, and this would be pretty easy with systemd.

– Michael Hampton
Sep 29 '18 at 1:07







Do you need to use an EOL or nearly EOL version of Ubuntu? Current versions of Ubuntu use systemd instead of upstart, and this would be pretty easy with systemd.

– Michael Hampton
Sep 29 '18 at 1:07












1 Answer
1






active

oldest

votes


















0














Create a new job (foo-failure-notification) that starts when the main job (foo) exits unsuccessfully:



start on stopped foo RESULT!='ok'
task
exec foo-failure-notification-script




share























    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%2f933173%2fupstart-how-to-run-cmd-or-script-instead-of-respawn%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Create a new job (foo-failure-notification) that starts when the main job (foo) exits unsuccessfully:



    start on stopped foo RESULT!='ok'
    task
    exec foo-failure-notification-script




    share




























      0














      Create a new job (foo-failure-notification) that starts when the main job (foo) exits unsuccessfully:



      start on stopped foo RESULT!='ok'
      task
      exec foo-failure-notification-script




      share


























        0












        0








        0







        Create a new job (foo-failure-notification) that starts when the main job (foo) exits unsuccessfully:



        start on stopped foo RESULT!='ok'
        task
        exec foo-failure-notification-script




        share













        Create a new job (foo-failure-notification) that starts when the main job (foo) exits unsuccessfully:



        start on stopped foo RESULT!='ok'
        task
        exec foo-failure-notification-script





        share











        share


        share










        answered 4 mins ago









        CameronNemoCameronNemo

        39916




        39916






























            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%2f933173%2fupstart-how-to-run-cmd-or-script-instead-of-respawn%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

            117736 Шеррод Примітки | Див. також | Посилання | Навігаційне...

            As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

            Маріан Котлеба Зміст Життєпис | Політичні погляди |...