How to Enable /etc/rc.local with Systemd 18.04 LTS [duplicate]











up vote
0
down vote

favorite













This question already has an answer here:




  • How can I execute command on startup (rc.local alternative) on Ubuntu 16.10

    3 answers




i tried to install /etc/rc.local and i am stuck in this step



terminal pic










share|improve this question















marked as duplicate by George Udosen, karel, Eric Carvalho, Fabby, Tom Brossman 2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Please post text and not images. You can do copy&paste from your terminal into the text box for the question.
    – Filipe Brandenburger
    Nov 22 at 18:56










  • i did that already :(
    – ChangEtheColours
    2 days ago















up vote
0
down vote

favorite













This question already has an answer here:




  • How can I execute command on startup (rc.local alternative) on Ubuntu 16.10

    3 answers




i tried to install /etc/rc.local and i am stuck in this step



terminal pic










share|improve this question















marked as duplicate by George Udosen, karel, Eric Carvalho, Fabby, Tom Brossman 2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Please post text and not images. You can do copy&paste from your terminal into the text box for the question.
    – Filipe Brandenburger
    Nov 22 at 18:56










  • i did that already :(
    – ChangEtheColours
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:




  • How can I execute command on startup (rc.local alternative) on Ubuntu 16.10

    3 answers




i tried to install /etc/rc.local and i am stuck in this step



terminal pic










share|improve this question
















This question already has an answer here:




  • How can I execute command on startup (rc.local alternative) on Ubuntu 16.10

    3 answers




i tried to install /etc/rc.local and i am stuck in this step



terminal pic





This question already has an answer here:




  • How can I execute command on startup (rc.local alternative) on Ubuntu 16.10

    3 answers








software-installation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 17:58









S_Flash

1,039217




1,039217










asked Nov 22 at 17:54









ChangEtheColours

14




14




marked as duplicate by George Udosen, karel, Eric Carvalho, Fabby, Tom Brossman 2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by George Udosen, karel, Eric Carvalho, Fabby, Tom Brossman 2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Please post text and not images. You can do copy&paste from your terminal into the text box for the question.
    – Filipe Brandenburger
    Nov 22 at 18:56










  • i did that already :(
    – ChangEtheColours
    2 days ago


















  • Please post text and not images. You can do copy&paste from your terminal into the text box for the question.
    – Filipe Brandenburger
    Nov 22 at 18:56










  • i did that already :(
    – ChangEtheColours
    2 days ago
















Please post text and not images. You can do copy&paste from your terminal into the text box for the question.
– Filipe Brandenburger
Nov 22 at 18:56




Please post text and not images. You can do copy&paste from your terminal into the text box for the question.
– Filipe Brandenburger
Nov 22 at 18:56












i did that already :(
– ChangEtheColours
2 days ago




i did that already :(
– ChangEtheColours
2 days ago










2 Answers
2






active

oldest

votes

















up vote
0
down vote













The error you're getting is:



Failed to execute command: Exec format error


That means systemd is trying to execute /etc/rc.local as an executable (for instance, a shell script), but that is failing since it appears the /etc/rc.local file is not a valid executable.



Please take a look at its contents. If it's a script, do you have a proper "shebang" line, such as #!/bin/sh or #!/bin/bash at the beginning?



Does the file have the "executable" bit set? (You can set it with chmod +x /etc/rc.local).



Please edit your answer and include the output of commands ls -l /etc/rc.local and file /etc/rc.local, which will help identify the exact issue you're having.





UPDATE: From your comment below, looks like you were missing the shebang line #!/bin/bash in your /etc/rc.local, adding that line fixed the problem.






share|improve this answer



















  • 1




    @ChangEtheColours Please post the solution as proper answer. Comments don't allow for extensive formatting, and it's impossible to understand what exactly has been changed in the script.
    – Sergiy Kolodyazhnyy
    Nov 22 at 23:14


















up vote
0
down vote













sorry cause i am late .. at the moment on terminal




systemctl status rc-local




FAILED



i send screenshot with commands




cat /etc/rc.local



ls -l /etc/rc.local



file /etc/rc.local




screenshot from terminal



BUT if i erase from




/etc/rc.local the




/usr/bin/garbd --cfg /etc/garbd.conf &
exit 0



and save only with




(#!/bin/bash )




then this screenshot from terminal






share|improve this answer






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    The error you're getting is:



    Failed to execute command: Exec format error


    That means systemd is trying to execute /etc/rc.local as an executable (for instance, a shell script), but that is failing since it appears the /etc/rc.local file is not a valid executable.



    Please take a look at its contents. If it's a script, do you have a proper "shebang" line, such as #!/bin/sh or #!/bin/bash at the beginning?



    Does the file have the "executable" bit set? (You can set it with chmod +x /etc/rc.local).



    Please edit your answer and include the output of commands ls -l /etc/rc.local and file /etc/rc.local, which will help identify the exact issue you're having.





    UPDATE: From your comment below, looks like you were missing the shebang line #!/bin/bash in your /etc/rc.local, adding that line fixed the problem.






    share|improve this answer



















    • 1




      @ChangEtheColours Please post the solution as proper answer. Comments don't allow for extensive formatting, and it's impossible to understand what exactly has been changed in the script.
      – Sergiy Kolodyazhnyy
      Nov 22 at 23:14















    up vote
    0
    down vote













    The error you're getting is:



    Failed to execute command: Exec format error


    That means systemd is trying to execute /etc/rc.local as an executable (for instance, a shell script), but that is failing since it appears the /etc/rc.local file is not a valid executable.



    Please take a look at its contents. If it's a script, do you have a proper "shebang" line, such as #!/bin/sh or #!/bin/bash at the beginning?



    Does the file have the "executable" bit set? (You can set it with chmod +x /etc/rc.local).



    Please edit your answer and include the output of commands ls -l /etc/rc.local and file /etc/rc.local, which will help identify the exact issue you're having.





    UPDATE: From your comment below, looks like you were missing the shebang line #!/bin/bash in your /etc/rc.local, adding that line fixed the problem.






    share|improve this answer



















    • 1




      @ChangEtheColours Please post the solution as proper answer. Comments don't allow for extensive formatting, and it's impossible to understand what exactly has been changed in the script.
      – Sergiy Kolodyazhnyy
      Nov 22 at 23:14













    up vote
    0
    down vote










    up vote
    0
    down vote









    The error you're getting is:



    Failed to execute command: Exec format error


    That means systemd is trying to execute /etc/rc.local as an executable (for instance, a shell script), but that is failing since it appears the /etc/rc.local file is not a valid executable.



    Please take a look at its contents. If it's a script, do you have a proper "shebang" line, such as #!/bin/sh or #!/bin/bash at the beginning?



    Does the file have the "executable" bit set? (You can set it with chmod +x /etc/rc.local).



    Please edit your answer and include the output of commands ls -l /etc/rc.local and file /etc/rc.local, which will help identify the exact issue you're having.





    UPDATE: From your comment below, looks like you were missing the shebang line #!/bin/bash in your /etc/rc.local, adding that line fixed the problem.






    share|improve this answer














    The error you're getting is:



    Failed to execute command: Exec format error


    That means systemd is trying to execute /etc/rc.local as an executable (for instance, a shell script), but that is failing since it appears the /etc/rc.local file is not a valid executable.



    Please take a look at its contents. If it's a script, do you have a proper "shebang" line, such as #!/bin/sh or #!/bin/bash at the beginning?



    Does the file have the "executable" bit set? (You can set it with chmod +x /etc/rc.local).



    Please edit your answer and include the output of commands ls -l /etc/rc.local and file /etc/rc.local, which will help identify the exact issue you're having.





    UPDATE: From your comment below, looks like you were missing the shebang line #!/bin/bash in your /etc/rc.local, adding that line fixed the problem.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 22 at 23:00

























    answered Nov 22 at 19:01









    Filipe Brandenburger

    6827




    6827








    • 1




      @ChangEtheColours Please post the solution as proper answer. Comments don't allow for extensive formatting, and it's impossible to understand what exactly has been changed in the script.
      – Sergiy Kolodyazhnyy
      Nov 22 at 23:14














    • 1




      @ChangEtheColours Please post the solution as proper answer. Comments don't allow for extensive formatting, and it's impossible to understand what exactly has been changed in the script.
      – Sergiy Kolodyazhnyy
      Nov 22 at 23:14








    1




    1




    @ChangEtheColours Please post the solution as proper answer. Comments don't allow for extensive formatting, and it's impossible to understand what exactly has been changed in the script.
    – Sergiy Kolodyazhnyy
    Nov 22 at 23:14




    @ChangEtheColours Please post the solution as proper answer. Comments don't allow for extensive formatting, and it's impossible to understand what exactly has been changed in the script.
    – Sergiy Kolodyazhnyy
    Nov 22 at 23:14












    up vote
    0
    down vote













    sorry cause i am late .. at the moment on terminal




    systemctl status rc-local




    FAILED



    i send screenshot with commands




    cat /etc/rc.local



    ls -l /etc/rc.local



    file /etc/rc.local




    screenshot from terminal



    BUT if i erase from




    /etc/rc.local the




    /usr/bin/garbd --cfg /etc/garbd.conf &
    exit 0



    and save only with




    (#!/bin/bash )




    then this screenshot from terminal






    share|improve this answer



























      up vote
      0
      down vote













      sorry cause i am late .. at the moment on terminal




      systemctl status rc-local




      FAILED



      i send screenshot with commands




      cat /etc/rc.local



      ls -l /etc/rc.local



      file /etc/rc.local




      screenshot from terminal



      BUT if i erase from




      /etc/rc.local the




      /usr/bin/garbd --cfg /etc/garbd.conf &
      exit 0



      and save only with




      (#!/bin/bash )




      then this screenshot from terminal






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        sorry cause i am late .. at the moment on terminal




        systemctl status rc-local




        FAILED



        i send screenshot with commands




        cat /etc/rc.local



        ls -l /etc/rc.local



        file /etc/rc.local




        screenshot from terminal



        BUT if i erase from




        /etc/rc.local the




        /usr/bin/garbd --cfg /etc/garbd.conf &
        exit 0



        and save only with




        (#!/bin/bash )




        then this screenshot from terminal






        share|improve this answer














        sorry cause i am late .. at the moment on terminal




        systemctl status rc-local




        FAILED



        i send screenshot with commands




        cat /etc/rc.local



        ls -l /etc/rc.local



        file /etc/rc.local




        screenshot from terminal



        BUT if i erase from




        /etc/rc.local the




        /usr/bin/garbd --cfg /etc/garbd.conf &
        exit 0



        and save only with




        (#!/bin/bash )




        then this screenshot from terminal







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 23 at 22:07

























        answered Nov 23 at 21:53









        ChangEtheColours

        14




        14















            Popular posts from this blog

            Category:香港粉麵

            List *all* the tuples!

            Channel [V]