Install Deamon (Zookeeper) but don't automatically start it












1















I've installed zookeeper and zookeeperd on 18.04 directly from the APT sources.
That works fine, but it gets started automatically. How can I prevent this?



Stopping the daemon afterward is possible, but i has a change that it will create any data with the example config.



We need this for immutable VM images, so i don't want to have any artifacts in the image.



I am sure this is not Zookeeper specific but I was not able to find anything.










share|improve this question





























    1















    I've installed zookeeper and zookeeperd on 18.04 directly from the APT sources.
    That works fine, but it gets started automatically. How can I prevent this?



    Stopping the daemon afterward is possible, but i has a change that it will create any data with the example config.



    We need this for immutable VM images, so i don't want to have any artifacts in the image.



    I am sure this is not Zookeeper specific but I was not able to find anything.










    share|improve this question



























      1












      1








      1








      I've installed zookeeper and zookeeperd on 18.04 directly from the APT sources.
      That works fine, but it gets started automatically. How can I prevent this?



      Stopping the daemon afterward is possible, but i has a change that it will create any data with the example config.



      We need this for immutable VM images, so i don't want to have any artifacts in the image.



      I am sure this is not Zookeeper specific but I was not able to find anything.










      share|improve this question
















      I've installed zookeeper and zookeeperd on 18.04 directly from the APT sources.
      That works fine, but it gets started automatically. How can I prevent this?



      Stopping the daemon afterward is possible, but i has a change that it will create any data with the example config.



      We need this for immutable VM images, so i don't want to have any artifacts in the image.



      I am sure this is not Zookeeper specific but I was not able to find anything.







      apt 18.04 systemd






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 8 at 12:16







      Mark Eisenblätter

















      asked Jan 8 at 6:46









      Mark EisenblätterMark Eisenblätter

      85




      85






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You can simply do:



          sudo systemctl disable zoo


          If you’d like to prevent daemons from starting after installing a package, just toss a few lines into /usr/sbin/policy-rc.d:



          sudo -i
          cat > /usr/sbin/policy-rc.d << EOF
          #!/bin/sh
          echo "All runlevel operations denied by policy" >&2
          exit 101
          EOF
          exit


          Now, install any packages that you need and the daemons will remain stopped until you start them (or reboot the server). Be sure to remove the policy file you added once you’re done installing your packages.






          share|improve this answer


























          • Yes but, at this time the Service has already started and their is maye some data written, from the wrong example config.

            – Mark Eisenblätter
            Jan 8 at 10:03











          • You wont to install zookeeper and not start it directly after installing?

            – Mirosław Mówiński
            Jan 8 at 10:07











          • Yes, we use Immutable images on VM basis and try to create the image first.

            – Mark Eisenblätter
            Jan 8 at 10:23











          • @MarkEisenblätter i've edited main reply :) please check if it works for you, if yes please upvote my comment :D

            – Mirosław Mówiński
            Jan 8 at 11:40











          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%2f1107891%2finstall-deamon-zookeeper-but-dont-automatically-start-it%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









          1














          You can simply do:



          sudo systemctl disable zoo


          If you’d like to prevent daemons from starting after installing a package, just toss a few lines into /usr/sbin/policy-rc.d:



          sudo -i
          cat > /usr/sbin/policy-rc.d << EOF
          #!/bin/sh
          echo "All runlevel operations denied by policy" >&2
          exit 101
          EOF
          exit


          Now, install any packages that you need and the daemons will remain stopped until you start them (or reboot the server). Be sure to remove the policy file you added once you’re done installing your packages.






          share|improve this answer


























          • Yes but, at this time the Service has already started and their is maye some data written, from the wrong example config.

            – Mark Eisenblätter
            Jan 8 at 10:03











          • You wont to install zookeeper and not start it directly after installing?

            – Mirosław Mówiński
            Jan 8 at 10:07











          • Yes, we use Immutable images on VM basis and try to create the image first.

            – Mark Eisenblätter
            Jan 8 at 10:23











          • @MarkEisenblätter i've edited main reply :) please check if it works for you, if yes please upvote my comment :D

            – Mirosław Mówiński
            Jan 8 at 11:40
















          1














          You can simply do:



          sudo systemctl disable zoo


          If you’d like to prevent daemons from starting after installing a package, just toss a few lines into /usr/sbin/policy-rc.d:



          sudo -i
          cat > /usr/sbin/policy-rc.d << EOF
          #!/bin/sh
          echo "All runlevel operations denied by policy" >&2
          exit 101
          EOF
          exit


          Now, install any packages that you need and the daemons will remain stopped until you start them (or reboot the server). Be sure to remove the policy file you added once you’re done installing your packages.






          share|improve this answer


























          • Yes but, at this time the Service has already started and their is maye some data written, from the wrong example config.

            – Mark Eisenblätter
            Jan 8 at 10:03











          • You wont to install zookeeper and not start it directly after installing?

            – Mirosław Mówiński
            Jan 8 at 10:07











          • Yes, we use Immutable images on VM basis and try to create the image first.

            – Mark Eisenblätter
            Jan 8 at 10:23











          • @MarkEisenblätter i've edited main reply :) please check if it works for you, if yes please upvote my comment :D

            – Mirosław Mówiński
            Jan 8 at 11:40














          1












          1








          1







          You can simply do:



          sudo systemctl disable zoo


          If you’d like to prevent daemons from starting after installing a package, just toss a few lines into /usr/sbin/policy-rc.d:



          sudo -i
          cat > /usr/sbin/policy-rc.d << EOF
          #!/bin/sh
          echo "All runlevel operations denied by policy" >&2
          exit 101
          EOF
          exit


          Now, install any packages that you need and the daemons will remain stopped until you start them (or reboot the server). Be sure to remove the policy file you added once you’re done installing your packages.






          share|improve this answer















          You can simply do:



          sudo systemctl disable zoo


          If you’d like to prevent daemons from starting after installing a package, just toss a few lines into /usr/sbin/policy-rc.d:



          sudo -i
          cat > /usr/sbin/policy-rc.d << EOF
          #!/bin/sh
          echo "All runlevel operations denied by policy" >&2
          exit 101
          EOF
          exit


          Now, install any packages that you need and the daemons will remain stopped until you start them (or reboot the server). Be sure to remove the policy file you added once you’re done installing your packages.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 8 at 11:44









          Zanna

          50.6k13134241




          50.6k13134241










          answered Jan 8 at 9:49









          Mirosław MówińskiMirosław Mówiński

          664




          664













          • Yes but, at this time the Service has already started and their is maye some data written, from the wrong example config.

            – Mark Eisenblätter
            Jan 8 at 10:03











          • You wont to install zookeeper and not start it directly after installing?

            – Mirosław Mówiński
            Jan 8 at 10:07











          • Yes, we use Immutable images on VM basis and try to create the image first.

            – Mark Eisenblätter
            Jan 8 at 10:23











          • @MarkEisenblätter i've edited main reply :) please check if it works for you, if yes please upvote my comment :D

            – Mirosław Mówiński
            Jan 8 at 11:40



















          • Yes but, at this time the Service has already started and their is maye some data written, from the wrong example config.

            – Mark Eisenblätter
            Jan 8 at 10:03











          • You wont to install zookeeper and not start it directly after installing?

            – Mirosław Mówiński
            Jan 8 at 10:07











          • Yes, we use Immutable images on VM basis and try to create the image first.

            – Mark Eisenblätter
            Jan 8 at 10:23











          • @MarkEisenblätter i've edited main reply :) please check if it works for you, if yes please upvote my comment :D

            – Mirosław Mówiński
            Jan 8 at 11:40

















          Yes but, at this time the Service has already started and their is maye some data written, from the wrong example config.

          – Mark Eisenblätter
          Jan 8 at 10:03





          Yes but, at this time the Service has already started and their is maye some data written, from the wrong example config.

          – Mark Eisenblätter
          Jan 8 at 10:03













          You wont to install zookeeper and not start it directly after installing?

          – Mirosław Mówiński
          Jan 8 at 10:07





          You wont to install zookeeper and not start it directly after installing?

          – Mirosław Mówiński
          Jan 8 at 10:07













          Yes, we use Immutable images on VM basis and try to create the image first.

          – Mark Eisenblätter
          Jan 8 at 10:23





          Yes, we use Immutable images on VM basis and try to create the image first.

          – Mark Eisenblätter
          Jan 8 at 10:23













          @MarkEisenblätter i've edited main reply :) please check if it works for you, if yes please upvote my comment :D

          – Mirosław Mówiński
          Jan 8 at 11:40





          @MarkEisenblätter i've edited main reply :) please check if it works for you, if yes please upvote my comment :D

          – Mirosław Mówiński
          Jan 8 at 11:40


















          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%2f1107891%2finstall-deamon-zookeeper-but-dont-automatically-start-it%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

          Human spaceflight

          Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

          張江高科駅