Why isn't my systemd service automatically starting?












1















Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:



[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service

[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent

[Install]
WantedBy=multi-user.target


It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:



systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)


What do I have to do to make this start up automatically on boot?



Edit



In YOCTO, the equivalent to calling systemctl enable is:



SYSTEMD_SERVICE_${PN} = " 
boondocks-agent.service
"









share|improve this question

























  • @UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.

    – RQDQ
    May 4 '18 at 12:54











  • If this is a user-supplied unit, you really want to put it in /etc/systemd/system: the /lib/systemd/system directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/ files will override anything in /lib/systemd/, preventing potential issues in the future.

    – ErikF
    May 4 '18 at 17:55











  • @ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.

    – RQDQ
    May 4 '18 at 18:24











  • Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.

    – ErikF
    May 4 '18 at 18:51











  • @ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)

    – RQDQ
    May 4 '18 at 19:34


















1















Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:



[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service

[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent

[Install]
WantedBy=multi-user.target


It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:



systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)


What do I have to do to make this start up automatically on boot?



Edit



In YOCTO, the equivalent to calling systemctl enable is:



SYSTEMD_SERVICE_${PN} = " 
boondocks-agent.service
"









share|improve this question

























  • @UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.

    – RQDQ
    May 4 '18 at 12:54











  • If this is a user-supplied unit, you really want to put it in /etc/systemd/system: the /lib/systemd/system directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/ files will override anything in /lib/systemd/, preventing potential issues in the future.

    – ErikF
    May 4 '18 at 17:55











  • @ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.

    – RQDQ
    May 4 '18 at 18:24











  • Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.

    – ErikF
    May 4 '18 at 18:51











  • @ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)

    – RQDQ
    May 4 '18 at 19:34
















1












1








1








Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:



[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service

[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent

[Install]
WantedBy=multi-user.target


It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:



systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)


What do I have to do to make this start up automatically on boot?



Edit



In YOCTO, the equivalent to calling systemctl enable is:



SYSTEMD_SERVICE_${PN} = " 
boondocks-agent.service
"









share|improve this question
















Here is my boondocks-agent.service file. I have installed it in /lib/systemd/system:



[Unit]
Description=Boondocks agent
Requires=
balena.service
After=
balena.service

[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent

[Install]
WantedBy=multi-user.target


It doesn't appear to start up when I boot the system. After a clean boot, this is what I see for status:



systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)


What do I have to do to make this start up automatically on boot?



Edit



In YOCTO, the equivalent to calling systemctl enable is:



SYSTEMD_SERVICE_${PN} = " 
boondocks-agent.service
"






systemd yocto






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 4 '18 at 13:04







RQDQ

















asked May 4 '18 at 12:50









RQDQRQDQ

1086




1086













  • @UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.

    – RQDQ
    May 4 '18 at 12:54











  • If this is a user-supplied unit, you really want to put it in /etc/systemd/system: the /lib/systemd/system directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/ files will override anything in /lib/systemd/, preventing potential issues in the future.

    – ErikF
    May 4 '18 at 17:55











  • @ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.

    – RQDQ
    May 4 '18 at 18:24











  • Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.

    – ErikF
    May 4 '18 at 18:51











  • @ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)

    – RQDQ
    May 4 '18 at 19:34





















  • @UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.

    – RQDQ
    May 4 '18 at 12:54











  • If this is a user-supplied unit, you really want to put it in /etc/systemd/system: the /lib/systemd/system directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/ files will override anything in /lib/systemd/, preventing potential issues in the future.

    – ErikF
    May 4 '18 at 17:55











  • @ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.

    – RQDQ
    May 4 '18 at 18:24











  • Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.

    – ErikF
    May 4 '18 at 18:51











  • @ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)

    – RQDQ
    May 4 '18 at 19:34



















@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.

– RQDQ
May 4 '18 at 12:54





@UlrichSchwarz - apologies - the actual service file has the absolute path. The original question has the template I use to generate the file in a YOCTO build. I'll edit.

– RQDQ
May 4 '18 at 12:54













If this is a user-supplied unit, you really want to put it in /etc/systemd/system: the /lib/systemd/system directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/ files will override anything in /lib/systemd/, preventing potential issues in the future.

– ErikF
May 4 '18 at 17:55





If this is a user-supplied unit, you really want to put it in /etc/systemd/system: the /lib/systemd/system directory is for the distribution's use. Although installers are good about not messing with foreign files, it's a risk that you don't have to take! Also, your /etc/systemd/ files will override anything in /lib/systemd/, preventing potential issues in the future.

– ErikF
May 4 '18 at 17:55













@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.

– RQDQ
May 4 '18 at 18:24





@ErikF - I think in this case, because I'm building the distribution using YOCTO, I am the distribution.

– RQDQ
May 4 '18 at 18:24













Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.

– ErikF
May 4 '18 at 18:51





Sorry, I forgot about that. I've gotten lazy and let my distros do all the grunt work for me! :-) I should really give it a shot; YOCTO looks really interesting.

– ErikF
May 4 '18 at 18:51













@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)

– RQDQ
May 4 '18 at 19:34







@ErikF - YOCTO is great - once you get past the really really steep learning curve. :-)

– RQDQ
May 4 '18 at 19:34












2 Answers
2






active

oldest

votes


















4














You need to enable it a boot time:



systemctl enable boondocks-agent






share|improve this answer































    0















    In YOCTO, the equivalent to calling systemctl enable is:



    SYSTEMD_SERVICE_${PN} = "
    boondocks-agent.service
    "




    I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
    SYSTEMD_AUTO_ENABLE_${PN} = "enable"






    share|improve this answer








    New contributor




    cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f441777%2fwhy-isnt-my-systemd-service-automatically-starting%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4














      You need to enable it a boot time:



      systemctl enable boondocks-agent






      share|improve this answer




























        4














        You need to enable it a boot time:



        systemctl enable boondocks-agent






        share|improve this answer


























          4












          4








          4







          You need to enable it a boot time:



          systemctl enable boondocks-agent






          share|improve this answer













          You need to enable it a boot time:



          systemctl enable boondocks-agent







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 4 '18 at 12:56









          BigonBigon

          1,255713




          1,255713

























              0















              In YOCTO, the equivalent to calling systemctl enable is:



              SYSTEMD_SERVICE_${PN} = "
              boondocks-agent.service
              "




              I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
              SYSTEMD_AUTO_ENABLE_${PN} = "enable"






              share|improve this answer








              New contributor




              cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0















                In YOCTO, the equivalent to calling systemctl enable is:



                SYSTEMD_SERVICE_${PN} = "
                boondocks-agent.service
                "




                I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
                SYSTEMD_AUTO_ENABLE_${PN} = "enable"






                share|improve this answer








                New contributor




                cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0








                  In YOCTO, the equivalent to calling systemctl enable is:



                  SYSTEMD_SERVICE_${PN} = "
                  boondocks-agent.service
                  "




                  I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
                  SYSTEMD_AUTO_ENABLE_${PN} = "enable"






                  share|improve this answer








                  New contributor




                  cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.











                  In YOCTO, the equivalent to calling systemctl enable is:



                  SYSTEMD_SERVICE_${PN} = "
                  boondocks-agent.service
                  "




                  I think this is the equivalent to installing the service. To have the service default to enabled you would want to add:
                  SYSTEMD_AUTO_ENABLE_${PN} = "enable"







                  share|improve this answer








                  New contributor




                  cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 28 mins ago









                  cprewitcprewit

                  11




                  11




                  New contributor




                  cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  cprewit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • 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%2funix.stackexchange.com%2fquestions%2f441777%2fwhy-isnt-my-systemd-service-automatically-starting%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

                      Accessing regular linux commands in Huawei's Dopra Linux

                      Can't connect RFCOMM socket: Host is down

                      Kernel panic - not syncing: Fatal Exception in Interrupt