systemd: Cannot disable generated unit file

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











up vote
1
down vote

favorite












How can I disable a unit generated by systemd-fstab-generator or systemd.generator?



Here's my attempt:



$ systemctl is-enabled media-backup.automount
generated
$ echo $?
0
$ sudo systemctl disable media-backup.automount
$ echo $?
0
$ systemctl is-enabled media-backup.automount
generated
$ echo $?
0


As you can see from the exit status 0 the .automount unit is still enabled.







share|improve this question
























    up vote
    1
    down vote

    favorite












    How can I disable a unit generated by systemd-fstab-generator or systemd.generator?



    Here's my attempt:



    $ systemctl is-enabled media-backup.automount
    generated
    $ echo $?
    0
    $ sudo systemctl disable media-backup.automount
    $ echo $?
    0
    $ systemctl is-enabled media-backup.automount
    generated
    $ echo $?
    0


    As you can see from the exit status 0 the .automount unit is still enabled.







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      How can I disable a unit generated by systemd-fstab-generator or systemd.generator?



      Here's my attempt:



      $ systemctl is-enabled media-backup.automount
      generated
      $ echo $?
      0
      $ sudo systemctl disable media-backup.automount
      $ echo $?
      0
      $ systemctl is-enabled media-backup.automount
      generated
      $ echo $?
      0


      As you can see from the exit status 0 the .automount unit is still enabled.







      share|improve this question












      How can I disable a unit generated by systemd-fstab-generator or systemd.generator?



      Here's my attempt:



      $ systemctl is-enabled media-backup.automount
      generated
      $ echo $?
      0
      $ sudo systemctl disable media-backup.automount
      $ echo $?
      0
      $ systemctl is-enabled media-backup.automount
      generated
      $ echo $?
      0


      As you can see from the exit status 0 the .automount unit is still enabled.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 '17 at 9:10









      Tom Hale

      5,82422576




      5,82422576




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          You can use noauto option in fstab to disable systemd from automatically mounting the fstab entry.






          share|improve this answer



























            up vote
            1
            down vote



            accepted










            From this answer:




            Generated unit files are not automatically activated by systemd. There's nothing special about them as far as systemd is concerned. Each individual generator has to explicitly create symbolic links that connect a generated unit to a target, so that activating the target activates the generated unit via a dependency in the normal way.




            Removing the symlink under /run/systemd/generator/local-fs.target.wants will disable the .automount until the next boot.



            To stop the boot-time generation of the unit, add noauto to the /etc/fstab entry as sebasth said.



            Be aware that there is some magic required tostop an.automount` unit without unmounting the filesystem.






            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%2f405566%2fsystemd-cannot-disable-generated-unit-file%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              You can use noauto option in fstab to disable systemd from automatically mounting the fstab entry.






              share|improve this answer
























                up vote
                1
                down vote













                You can use noauto option in fstab to disable systemd from automatically mounting the fstab entry.






                share|improve this answer






















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  You can use noauto option in fstab to disable systemd from automatically mounting the fstab entry.






                  share|improve this answer












                  You can use noauto option in fstab to disable systemd from automatically mounting the fstab entry.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 19 '17 at 11:27









                  sebasth

                  5,93921641




                  5,93921641






















                      up vote
                      1
                      down vote



                      accepted










                      From this answer:




                      Generated unit files are not automatically activated by systemd. There's nothing special about them as far as systemd is concerned. Each individual generator has to explicitly create symbolic links that connect a generated unit to a target, so that activating the target activates the generated unit via a dependency in the normal way.




                      Removing the symlink under /run/systemd/generator/local-fs.target.wants will disable the .automount until the next boot.



                      To stop the boot-time generation of the unit, add noauto to the /etc/fstab entry as sebasth said.



                      Be aware that there is some magic required tostop an.automount` unit without unmounting the filesystem.






                      share|improve this answer


























                        up vote
                        1
                        down vote



                        accepted










                        From this answer:




                        Generated unit files are not automatically activated by systemd. There's nothing special about them as far as systemd is concerned. Each individual generator has to explicitly create symbolic links that connect a generated unit to a target, so that activating the target activates the generated unit via a dependency in the normal way.




                        Removing the symlink under /run/systemd/generator/local-fs.target.wants will disable the .automount until the next boot.



                        To stop the boot-time generation of the unit, add noauto to the /etc/fstab entry as sebasth said.



                        Be aware that there is some magic required tostop an.automount` unit without unmounting the filesystem.






                        share|improve this answer
























                          up vote
                          1
                          down vote



                          accepted







                          up vote
                          1
                          down vote



                          accepted






                          From this answer:




                          Generated unit files are not automatically activated by systemd. There's nothing special about them as far as systemd is concerned. Each individual generator has to explicitly create symbolic links that connect a generated unit to a target, so that activating the target activates the generated unit via a dependency in the normal way.




                          Removing the symlink under /run/systemd/generator/local-fs.target.wants will disable the .automount until the next boot.



                          To stop the boot-time generation of the unit, add noauto to the /etc/fstab entry as sebasth said.



                          Be aware that there is some magic required tostop an.automount` unit without unmounting the filesystem.






                          share|improve this answer














                          From this answer:




                          Generated unit files are not automatically activated by systemd. There's nothing special about them as far as systemd is concerned. Each individual generator has to explicitly create symbolic links that connect a generated unit to a target, so that activating the target activates the generated unit via a dependency in the normal way.




                          Removing the symlink under /run/systemd/generator/local-fs.target.wants will disable the .automount until the next boot.



                          To stop the boot-time generation of the unit, add noauto to the /etc/fstab entry as sebasth said.



                          Be aware that there is some magic required tostop an.automount` unit without unmounting the filesystem.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 21 '17 at 9:12

























                          answered Nov 21 '17 at 9:04









                          Tom Hale

                          5,82422576




                          5,82422576



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405566%2fsystemd-cannot-disable-generated-unit-file%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?