Ubuntu 16 - How to make Systemd keep on trying to start service even when start condition failed?Using /usr/local/bin/mpd instead of /usr/bin/mpdMongoDB 3.0.2 won't start after upgrading to Ubuntu 16.04MySQL not working after upgrade from 14.04 to 16.04Second ssh instance won't start after upgrade to Xenial Xerus - Permission deniedWhy does my systemd service shut down immediately after running?Systemd doesn't restart monit after killWhat is the proper way to install ZooKeeper on Ubuntu 16.04 for both standalone and multi-node deployment?Install Redis-Server on Ubuntu 16.04 LTS minimalsystemd-networkd.socket failed. Any ideas on what to do?ubuntu snmpd ignores /etc/default/snmpd

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

Can a Gentile theist be saved?

Can a Bard use an arcane focus?

No idea how to draw this using tikz

Is infinity mathematically observable?

How to color a zone in Tikz

Partial sums of primes

Can the electrostatic force be infinite in magnitude?

Can I create an upright 7-foot × 5-foot wall with the Minor Illusion spell?

Calculating the number of days between 2 dates in Excel

Lifted its hind leg on or lifted its hind leg towards?

Organic chemistry Iodoform Reaction

Female=gender counterpart?

Was the picture area of a CRT a parallelogram (instead of a true rectangle)?

What does the "3am" section means in manpages?

Meta programming: Declare a new struct on the fly

Giant Toughroad SLR 2 for 200 miles in two days, will it make it?

Can I rely on these GitHub repository files?

Are Warlocks Arcane or Divine?

Why are on-board computers allowed to change controls without notifying the pilots?

Word describing multiple paths to the same abstract outcome

Should my PhD thesis be submitted under my legal name?

What do you call the infoboxes with text and sometimes images on the side of a page we find in textbooks?

Can the harmonic series explain the origin of the major scale?



Ubuntu 16 - How to make Systemd keep on trying to start service even when start condition failed?


Using /usr/local/bin/mpd instead of /usr/bin/mpdMongoDB 3.0.2 won't start after upgrading to Ubuntu 16.04MySQL not working after upgrade from 14.04 to 16.04Second ssh instance won't start after upgrade to Xenial Xerus - Permission deniedWhy does my systemd service shut down immediately after running?Systemd doesn't restart monit after killWhat is the proper way to install ZooKeeper on Ubuntu 16.04 for both standalone and multi-node deployment?Install Redis-Server on Ubuntu 16.04 LTS minimalsystemd-networkd.socket failed. Any ideas on what to do?ubuntu snmpd ignores /etc/default/snmpd













0















I have a sytemd unit file for kafka like below.



[Unit]
Description=Apache Kafka server (broker)
Documentation=http://kafka.apache.org/documentation.html
Requires=network.target remote-fs.target
After=network.target remote-fs.target kafka-zookeeper.service

[Service]
Type=simple
User=nano
Group=nano
Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
ExecStop=/opt/kafka/bin/kafka-server-stop.sh
RestartSec=2s
Restart=always

[Install]
WantedBy=multi-user.target


Zookeeper unit file.



[Service]
Type=simple
User=nano
Group=nano
Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
ExecStart=/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties
ExecStop=/opt/kafka/bin/zookeeper-server-stop.sh
RestartSec=2s
Restart=always


Sometimes I am observing that kafka is in a stopped state and doing systemctl status kafka.service showing me the below message



ubuntu@platform3:/usr/lib/systemd/system$ sudo systemctl status kafka.service
● kafka.service - Kafka Service
Loaded: loaded (/usr/lib/systemd/system/kafka.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Mon 2019-03-25 17:56:30 UTC; 10h ago


On checking logs it seems when sudo systemctl start kafka.service was executed that time zookeeper was not running . So the pre-condition did not meet and kafka did not start.



But after sometime zookeeper was up and running but even then Kafka did not start. Can someone let me know if there is a way I can make systemd keep on trying to start kafka and not just stop once if pre-conditions are not met like the way it is happening now?









share


























    0















    I have a sytemd unit file for kafka like below.



    [Unit]
    Description=Apache Kafka server (broker)
    Documentation=http://kafka.apache.org/documentation.html
    Requires=network.target remote-fs.target
    After=network.target remote-fs.target kafka-zookeeper.service

    [Service]
    Type=simple
    User=nano
    Group=nano
    Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
    ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
    ExecStop=/opt/kafka/bin/kafka-server-stop.sh
    RestartSec=2s
    Restart=always

    [Install]
    WantedBy=multi-user.target


    Zookeeper unit file.



    [Service]
    Type=simple
    User=nano
    Group=nano
    Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
    ExecStart=/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties
    ExecStop=/opt/kafka/bin/zookeeper-server-stop.sh
    RestartSec=2s
    Restart=always


    Sometimes I am observing that kafka is in a stopped state and doing systemctl status kafka.service showing me the below message



    ubuntu@platform3:/usr/lib/systemd/system$ sudo systemctl status kafka.service
    ● kafka.service - Kafka Service
    Loaded: loaded (/usr/lib/systemd/system/kafka.service; enabled; vendor preset: enabled)
    Active: inactive (dead)
    Condition: start condition failed at Mon 2019-03-25 17:56:30 UTC; 10h ago


    On checking logs it seems when sudo systemctl start kafka.service was executed that time zookeeper was not running . So the pre-condition did not meet and kafka did not start.



    But after sometime zookeeper was up and running but even then Kafka did not start. Can someone let me know if there is a way I can make systemd keep on trying to start kafka and not just stop once if pre-conditions are not met like the way it is happening now?









    share
























      0












      0








      0








      I have a sytemd unit file for kafka like below.



      [Unit]
      Description=Apache Kafka server (broker)
      Documentation=http://kafka.apache.org/documentation.html
      Requires=network.target remote-fs.target
      After=network.target remote-fs.target kafka-zookeeper.service

      [Service]
      Type=simple
      User=nano
      Group=nano
      Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
      ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
      ExecStop=/opt/kafka/bin/kafka-server-stop.sh
      RestartSec=2s
      Restart=always

      [Install]
      WantedBy=multi-user.target


      Zookeeper unit file.



      [Service]
      Type=simple
      User=nano
      Group=nano
      Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
      ExecStart=/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties
      ExecStop=/opt/kafka/bin/zookeeper-server-stop.sh
      RestartSec=2s
      Restart=always


      Sometimes I am observing that kafka is in a stopped state and doing systemctl status kafka.service showing me the below message



      ubuntu@platform3:/usr/lib/systemd/system$ sudo systemctl status kafka.service
      ● kafka.service - Kafka Service
      Loaded: loaded (/usr/lib/systemd/system/kafka.service; enabled; vendor preset: enabled)
      Active: inactive (dead)
      Condition: start condition failed at Mon 2019-03-25 17:56:30 UTC; 10h ago


      On checking logs it seems when sudo systemctl start kafka.service was executed that time zookeeper was not running . So the pre-condition did not meet and kafka did not start.



      But after sometime zookeeper was up and running but even then Kafka did not start. Can someone let me know if there is a way I can make systemd keep on trying to start kafka and not just stop once if pre-conditions are not met like the way it is happening now?









      share














      I have a sytemd unit file for kafka like below.



      [Unit]
      Description=Apache Kafka server (broker)
      Documentation=http://kafka.apache.org/documentation.html
      Requires=network.target remote-fs.target
      After=network.target remote-fs.target kafka-zookeeper.service

      [Service]
      Type=simple
      User=nano
      Group=nano
      Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
      ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
      ExecStop=/opt/kafka/bin/kafka-server-stop.sh
      RestartSec=2s
      Restart=always

      [Install]
      WantedBy=multi-user.target


      Zookeeper unit file.



      [Service]
      Type=simple
      User=nano
      Group=nano
      Environment=JAVA_HOME=/usr/java/jdk1.8.0_102
      ExecStart=/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties
      ExecStop=/opt/kafka/bin/zookeeper-server-stop.sh
      RestartSec=2s
      Restart=always


      Sometimes I am observing that kafka is in a stopped state and doing systemctl status kafka.service showing me the below message



      ubuntu@platform3:/usr/lib/systemd/system$ sudo systemctl status kafka.service
      ● kafka.service - Kafka Service
      Loaded: loaded (/usr/lib/systemd/system/kafka.service; enabled; vendor preset: enabled)
      Active: inactive (dead)
      Condition: start condition failed at Mon 2019-03-25 17:56:30 UTC; 10h ago


      On checking logs it seems when sudo systemctl start kafka.service was executed that time zookeeper was not running . So the pre-condition did not meet and kafka did not start.



      But after sometime zookeeper was up and running but even then Kafka did not start. Can someone let me know if there is a way I can make systemd keep on trying to start kafka and not just stop once if pre-conditions are not met like the way it is happening now?







      16.04 systemd





      share












      share










      share



      share










      asked 9 mins ago









      tuktuk

      1136




      1136




















          0






          active

          oldest

          votes











          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',
          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%2faskubuntu.com%2fquestions%2f1128725%2fubuntu-16-how-to-make-systemd-keep-on-trying-to-start-service-even-when-start%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Ask Ubuntu!


          • 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%2faskubuntu.com%2fquestions%2f1128725%2fubuntu-16-how-to-make-systemd-keep-on-trying-to-start-service-even-when-start%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

          Is compression “encryption” under FCC regs?Signing of messages transmitted over ham radioWhy do Amateur Radio organizations in the United States oppose the relaxation of encryption prohibitions?How far from earth do FCC regulations apply?How can I know whether a radio is FCC approved?FCC tracking of unlicensed FRS/GMRS transmissionsWhy does the FCC put restrictions on symbol rates?legal - Do FCC regulations only apply in U.S.A?What are FCC/Industry Canada certification requirements for amateur radio related products?How to get professional or official clarification of FCC Part 97 rules for specific complicated situations?Is there any point to keep the CSCE after the FCC registers the upgrade?Do FCC regulations limit digital data rate?

          macOS: Name for app shortcut screen found by pinching with thumb and three fingers Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30UTC (7:30pm US/Eastern) Should an RSS feed of hot network questions feed any chat room(s) here?How do I get three finger gestures working again in Twitter for Mac after installing Lion?After my MacBook Pro sleeps some gestures don't work anymoreIs it possible to reassign the “Pinch with thumb and three fingers” gesture to activate Dashboard instead of Launchpad?Disable animation for “Swipe between full-screen apps”?OSX Yosemite Can't disable four-finger swipeDrag with three fingers missing in OS X 10.11 Beta “El Capitan” (15A215h)A shortcut for Merge all Windows on macOS SierraSet the hostname/computer name for macOSmacOS: Identify tool and keyboard shortcutQuickly save Screenshot in MacOS Mojave with keyboard Shortcut

          What's wrong with this bogus proof?What's wrong with this random variable proof?What's wrong with this proof that all UFDs are Bezout?What's wrong with this proof by contradiction?A bogus proof of countable power setWhat's wrong with this proof $1=i^2=-1$What is wrong with this proofWhat's wrong with this proof of symmetry of equality?What's wrong with this 1 = -1 proof?What's wrong with this proof? (Regular languages)What's wrong in this proof of 1=2?