Linux run service on boot - up as soon as possible

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











up vote
0
down vote

favorite












Here is my service:



# This service will run in parallel with other services
# create ... mouselogger.service
# /etc/systemd/system

[Unit]
Description=MojeUre boot init display

[Service]
Type=simple
# RemainAfterExit=yes
ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUreBoot.py
Restart=on-abort

[Install]
WantedBy=multi-user.target
Alias=mojeureboot.service


I want to run it right after I plug-in power into my rasppbery pi.



How should I re-edit this service? Script is in Python, basicaly it outputs some text on LCD screen which is connected to RPI.



Currently have this code in service, but still service starts after network:



[Unit]
Description=MojeUre boot init display
Before=network-pre.target
Wants=network-pre.target

[Service]
Type=simple
# RemainAfterExit=yes
ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUre.py
Restart=on-abort

[Install]
# WantedBy=basic.target
Alias=mojeureboot.service
WantedBy=network.target

enter code here
enter code here









share|improve this question















migrated from serverfault.com Aug 17 at 12:53


This question came from our site for system and network administrators.


















    up vote
    0
    down vote

    favorite












    Here is my service:



    # This service will run in parallel with other services
    # create ... mouselogger.service
    # /etc/systemd/system

    [Unit]
    Description=MojeUre boot init display

    [Service]
    Type=simple
    # RemainAfterExit=yes
    ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUreBoot.py
    Restart=on-abort

    [Install]
    WantedBy=multi-user.target
    Alias=mojeureboot.service


    I want to run it right after I plug-in power into my rasppbery pi.



    How should I re-edit this service? Script is in Python, basicaly it outputs some text on LCD screen which is connected to RPI.



    Currently have this code in service, but still service starts after network:



    [Unit]
    Description=MojeUre boot init display
    Before=network-pre.target
    Wants=network-pre.target

    [Service]
    Type=simple
    # RemainAfterExit=yes
    ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUre.py
    Restart=on-abort

    [Install]
    # WantedBy=basic.target
    Alias=mojeureboot.service
    WantedBy=network.target

    enter code here
    enter code here









    share|improve this question















    migrated from serverfault.com Aug 17 at 12:53


    This question came from our site for system and network administrators.
















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Here is my service:



      # This service will run in parallel with other services
      # create ... mouselogger.service
      # /etc/systemd/system

      [Unit]
      Description=MojeUre boot init display

      [Service]
      Type=simple
      # RemainAfterExit=yes
      ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUreBoot.py
      Restart=on-abort

      [Install]
      WantedBy=multi-user.target
      Alias=mojeureboot.service


      I want to run it right after I plug-in power into my rasppbery pi.



      How should I re-edit this service? Script is in Python, basicaly it outputs some text on LCD screen which is connected to RPI.



      Currently have this code in service, but still service starts after network:



      [Unit]
      Description=MojeUre boot init display
      Before=network-pre.target
      Wants=network-pre.target

      [Service]
      Type=simple
      # RemainAfterExit=yes
      ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUre.py
      Restart=on-abort

      [Install]
      # WantedBy=basic.target
      Alias=mojeureboot.service
      WantedBy=network.target

      enter code here
      enter code here









      share|improve this question















      Here is my service:



      # This service will run in parallel with other services
      # create ... mouselogger.service
      # /etc/systemd/system

      [Unit]
      Description=MojeUre boot init display

      [Service]
      Type=simple
      # RemainAfterExit=yes
      ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUreBoot.py
      Restart=on-abort

      [Install]
      WantedBy=multi-user.target
      Alias=mojeureboot.service


      I want to run it right after I plug-in power into my rasppbery pi.



      How should I re-edit this service? Script is in Python, basicaly it outputs some text on LCD screen which is connected to RPI.



      Currently have this code in service, but still service starts after network:



      [Unit]
      Description=MojeUre boot init display
      Before=network-pre.target
      Wants=network-pre.target

      [Service]
      Type=simple
      # RemainAfterExit=yes
      ExecStart=/usr/bin/python /home/mojeure/scripts/MojeUre.py
      Restart=on-abort

      [Install]
      # WantedBy=basic.target
      Alias=mojeureboot.service
      WantedBy=network.target

      enter code here
      enter code here






      boot systemd raspberry-pi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 21 at 10:31

























      asked Aug 17 at 12:45









      noname

      11




      11




      migrated from serverfault.com Aug 17 at 12:53


      This question came from our site for system and network administrators.






      migrated from serverfault.com Aug 17 at 12:53


      This question came from our site for system and network administrators.






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          It depends on what your script need to work propertly
          you have banch of targets to use in WantedBy directive. I'd use basic.target, or network.target (if you need data from network to be displayed)






          share|improve this answer




















          • Currently it tooks 25sec to run this service from boot, any chance to speed up boot service at startup?
            – noname
            Aug 20 at 9:58










          • try to run systemd-analyze plot > bootchart.svg and look what is starting so slow and is it possible to disable/change dependencies of smth
            – Alexander
            Aug 20 at 10:08










          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%2f463181%2flinux-run-service-on-boot-up-as-soon-as-possible%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
          0
          down vote













          It depends on what your script need to work propertly
          you have banch of targets to use in WantedBy directive. I'd use basic.target, or network.target (if you need data from network to be displayed)






          share|improve this answer




















          • Currently it tooks 25sec to run this service from boot, any chance to speed up boot service at startup?
            – noname
            Aug 20 at 9:58










          • try to run systemd-analyze plot > bootchart.svg and look what is starting so slow and is it possible to disable/change dependencies of smth
            – Alexander
            Aug 20 at 10:08














          up vote
          0
          down vote













          It depends on what your script need to work propertly
          you have banch of targets to use in WantedBy directive. I'd use basic.target, or network.target (if you need data from network to be displayed)






          share|improve this answer




















          • Currently it tooks 25sec to run this service from boot, any chance to speed up boot service at startup?
            – noname
            Aug 20 at 9:58










          • try to run systemd-analyze plot > bootchart.svg and look what is starting so slow and is it possible to disable/change dependencies of smth
            – Alexander
            Aug 20 at 10:08












          up vote
          0
          down vote










          up vote
          0
          down vote









          It depends on what your script need to work propertly
          you have banch of targets to use in WantedBy directive. I'd use basic.target, or network.target (if you need data from network to be displayed)






          share|improve this answer












          It depends on what your script need to work propertly
          you have banch of targets to use in WantedBy directive. I'd use basic.target, or network.target (if you need data from network to be displayed)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 17 at 13:34









          Alexander

          72013




          72013











          • Currently it tooks 25sec to run this service from boot, any chance to speed up boot service at startup?
            – noname
            Aug 20 at 9:58










          • try to run systemd-analyze plot > bootchart.svg and look what is starting so slow and is it possible to disable/change dependencies of smth
            – Alexander
            Aug 20 at 10:08
















          • Currently it tooks 25sec to run this service from boot, any chance to speed up boot service at startup?
            – noname
            Aug 20 at 9:58










          • try to run systemd-analyze plot > bootchart.svg and look what is starting so slow and is it possible to disable/change dependencies of smth
            – Alexander
            Aug 20 at 10:08















          Currently it tooks 25sec to run this service from boot, any chance to speed up boot service at startup?
          – noname
          Aug 20 at 9:58




          Currently it tooks 25sec to run this service from boot, any chance to speed up boot service at startup?
          – noname
          Aug 20 at 9:58












          try to run systemd-analyze plot > bootchart.svg and look what is starting so slow and is it possible to disable/change dependencies of smth
          – Alexander
          Aug 20 at 10:08




          try to run systemd-analyze plot > bootchart.svg and look what is starting so slow and is it possible to disable/change dependencies of smth
          – Alexander
          Aug 20 at 10:08

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463181%2flinux-run-service-on-boot-up-as-soon-as-possible%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?