How to restart spamassassin after failure

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








up vote
0
down vote

favorite












Periodically, I see the following in syslog:



systemd[1]: spamassassin.service: Main process exited, code=exited, status=255/n/a
systemd[1]: spamassassin.service: Unit entered failed state.
systemd[1]: spamassassin.service: Failed with result 'exit-code'.


but the service does not automatically restart. It does start successfully with:



sudo service spamassassin restart


Can I configure spamassassin to restart automatically after it fails?







share|improve this question















  • 1




    There is no component to 'restart' SpamAssassin by-default. You would have to configure some type of monitoring system that'd run to monitor software programs on the system and start them again if they are down. However, this is actually not going to solve the underlying problem of SpamAssassin occasionally closing or shutting off or crashing. The actual question you should be asking first is: "Why did SpamAssassin fail to start or fail to shut down gracefully?". Have you examined why it's dying first?
    – Thomas Ward♦
    Jun 4 at 23:02











  • You're right. But I was multi-tasking - addressing both the failure cause and the possibility of restart after failure at the same time.
    – flymike
    Jun 5 at 4:08














up vote
0
down vote

favorite












Periodically, I see the following in syslog:



systemd[1]: spamassassin.service: Main process exited, code=exited, status=255/n/a
systemd[1]: spamassassin.service: Unit entered failed state.
systemd[1]: spamassassin.service: Failed with result 'exit-code'.


but the service does not automatically restart. It does start successfully with:



sudo service spamassassin restart


Can I configure spamassassin to restart automatically after it fails?







share|improve this question















  • 1




    There is no component to 'restart' SpamAssassin by-default. You would have to configure some type of monitoring system that'd run to monitor software programs on the system and start them again if they are down. However, this is actually not going to solve the underlying problem of SpamAssassin occasionally closing or shutting off or crashing. The actual question you should be asking first is: "Why did SpamAssassin fail to start or fail to shut down gracefully?". Have you examined why it's dying first?
    – Thomas Ward♦
    Jun 4 at 23:02











  • You're right. But I was multi-tasking - addressing both the failure cause and the possibility of restart after failure at the same time.
    – flymike
    Jun 5 at 4:08












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Periodically, I see the following in syslog:



systemd[1]: spamassassin.service: Main process exited, code=exited, status=255/n/a
systemd[1]: spamassassin.service: Unit entered failed state.
systemd[1]: spamassassin.service: Failed with result 'exit-code'.


but the service does not automatically restart. It does start successfully with:



sudo service spamassassin restart


Can I configure spamassassin to restart automatically after it fails?







share|improve this question











Periodically, I see the following in syslog:



systemd[1]: spamassassin.service: Main process exited, code=exited, status=255/n/a
systemd[1]: spamassassin.service: Unit entered failed state.
systemd[1]: spamassassin.service: Failed with result 'exit-code'.


but the service does not automatically restart. It does start successfully with:



sudo service spamassassin restart


Can I configure spamassassin to restart automatically after it fails?









share|improve this question










share|improve this question




share|improve this question









asked Jun 4 at 22:52









flymike

1757




1757







  • 1




    There is no component to 'restart' SpamAssassin by-default. You would have to configure some type of monitoring system that'd run to monitor software programs on the system and start them again if they are down. However, this is actually not going to solve the underlying problem of SpamAssassin occasionally closing or shutting off or crashing. The actual question you should be asking first is: "Why did SpamAssassin fail to start or fail to shut down gracefully?". Have you examined why it's dying first?
    – Thomas Ward♦
    Jun 4 at 23:02











  • You're right. But I was multi-tasking - addressing both the failure cause and the possibility of restart after failure at the same time.
    – flymike
    Jun 5 at 4:08












  • 1




    There is no component to 'restart' SpamAssassin by-default. You would have to configure some type of monitoring system that'd run to monitor software programs on the system and start them again if they are down. However, this is actually not going to solve the underlying problem of SpamAssassin occasionally closing or shutting off or crashing. The actual question you should be asking first is: "Why did SpamAssassin fail to start or fail to shut down gracefully?". Have you examined why it's dying first?
    – Thomas Ward♦
    Jun 4 at 23:02











  • You're right. But I was multi-tasking - addressing both the failure cause and the possibility of restart after failure at the same time.
    – flymike
    Jun 5 at 4:08







1




1




There is no component to 'restart' SpamAssassin by-default. You would have to configure some type of monitoring system that'd run to monitor software programs on the system and start them again if they are down. However, this is actually not going to solve the underlying problem of SpamAssassin occasionally closing or shutting off or crashing. The actual question you should be asking first is: "Why did SpamAssassin fail to start or fail to shut down gracefully?". Have you examined why it's dying first?
– Thomas Ward♦
Jun 4 at 23:02





There is no component to 'restart' SpamAssassin by-default. You would have to configure some type of monitoring system that'd run to monitor software programs on the system and start them again if they are down. However, this is actually not going to solve the underlying problem of SpamAssassin occasionally closing or shutting off or crashing. The actual question you should be asking first is: "Why did SpamAssassin fail to start or fail to shut down gracefully?". Have you examined why it's dying first?
– Thomas Ward♦
Jun 4 at 23:02













You're right. But I was multi-tasking - addressing both the failure cause and the possibility of restart after failure at the same time.
– flymike
Jun 5 at 4:08




You're right. But I was multi-tasking - addressing both the failure cause and the possibility of restart after failure at the same time.
– flymike
Jun 5 at 4:08










1 Answer
1






active

oldest

votes

















up vote
1
down vote













The manpage for systemd.service has the answer. For my particular case, the simplest solution was to add:



Restart=always
RestartSec=3


to the [Service] section of /lib/systemd/system/spamassassin.service



But there are more sophisticated controls available to limit restarts, should a failure loop occur.






share|improve this answer





















    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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f1043646%2fhow-to-restart-spamassassin-after-failure%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













    The manpage for systemd.service has the answer. For my particular case, the simplest solution was to add:



    Restart=always
    RestartSec=3


    to the [Service] section of /lib/systemd/system/spamassassin.service



    But there are more sophisticated controls available to limit restarts, should a failure loop occur.






    share|improve this answer

























      up vote
      1
      down vote













      The manpage for systemd.service has the answer. For my particular case, the simplest solution was to add:



      Restart=always
      RestartSec=3


      to the [Service] section of /lib/systemd/system/spamassassin.service



      But there are more sophisticated controls available to limit restarts, should a failure loop occur.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        The manpage for systemd.service has the answer. For my particular case, the simplest solution was to add:



        Restart=always
        RestartSec=3


        to the [Service] section of /lib/systemd/system/spamassassin.service



        But there are more sophisticated controls available to limit restarts, should a failure loop occur.






        share|improve this answer













        The manpage for systemd.service has the answer. For my particular case, the simplest solution was to add:



        Restart=always
        RestartSec=3


        to the [Service] section of /lib/systemd/system/spamassassin.service



        But there are more sophisticated controls available to limit restarts, should a failure loop occur.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Jun 5 at 4:02









        flymike

        1757




        1757






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1043646%2fhow-to-restart-spamassassin-after-failure%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

            `kcmshell` modules relation with `/usr/share/applications`

            How to enroll fingerprints to Ubuntu 17.10 with VFS491