How to run a python script automatically in Ubuntu 14.04 on reboot











up vote
0
down vote

favorite












I am trying to run a command on reboot. So that every time I restart my Ubuntu 14.04 server it should run automatically. It's a python command.



/usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc


I kept this command in /etc/init.d/rc.local file. But it's not working. Can anyone please help?










share|improve this question
























  • keep it in /etc/rc.local or preferably in ~/.profile
    – heemayl
    Mar 7 '15 at 15:07















up vote
0
down vote

favorite












I am trying to run a command on reboot. So that every time I restart my Ubuntu 14.04 server it should run automatically. It's a python command.



/usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc


I kept this command in /etc/init.d/rc.local file. But it's not working. Can anyone please help?










share|improve this question
























  • keep it in /etc/rc.local or preferably in ~/.profile
    – heemayl
    Mar 7 '15 at 15:07













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to run a command on reboot. So that every time I restart my Ubuntu 14.04 server it should run automatically. It's a python command.



/usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc


I kept this command in /etc/init.d/rc.local file. But it's not working. Can anyone please help?










share|improve this question















I am trying to run a command on reboot. So that every time I restart my Ubuntu 14.04 server it should run automatically. It's a python command.



/usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc


I kept this command in /etc/init.d/rc.local file. But it's not working. Can anyone please help?







14.04 python






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 '15 at 15:06









heemayl

65.7k8137210




65.7k8137210










asked Mar 7 '15 at 15:05









dirtyhandsphp

10113




10113












  • keep it in /etc/rc.local or preferably in ~/.profile
    – heemayl
    Mar 7 '15 at 15:07


















  • keep it in /etc/rc.local or preferably in ~/.profile
    – heemayl
    Mar 7 '15 at 15:07
















keep it in /etc/rc.local or preferably in ~/.profile
– heemayl
Mar 7 '15 at 15:07




keep it in /etc/rc.local or preferably in ~/.profile
– heemayl
Mar 7 '15 at 15:07










3 Answers
3






active

oldest

votes

















up vote
0
down vote













At system reboot, user shiv is not logged in



Is /home/shiv mounted? Not if you have an encrypted home directory (If /home/shiv/.Private is a link to /home/.ecryptfs/shiv/.Private you do).



Move (reinstall) the software and data that you have installed underneath /home/shiv to the /usr/local tree (see man hier (hier - description of the filesystem hierarchy).






share|improve this answer





















  • Hi waltinator. You are right at system reboot shiv user is not logged in. I can't install it again. I am new bie to Ubuntu. So can you please make me understand simply what exactly i have to do to achieve my results.
    – dirtyhandsphp
    Mar 7 '15 at 15:38










  • Do you have sudo access? Type sudo -l, and, when prompted, type YOUR LOGIN PASSWORD. If not, can you get your system administrator to help?
    – waltinator
    Mar 8 '15 at 17:45


















up vote
0
down vote













Create an Upstart job for your script: http://upstart.ubuntu.com/getting-started.html






share|improve this answer




























    up vote
    0
    down vote













    Open terminal by Crtl+ALT+T and execute following command:



    sudo -H /etc/rc.local


    Add the lines given below to the file but before exit 0.



    sudo /usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc





    share|improve this answer





















      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',
      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%2f593857%2fhow-to-run-a-python-script-automatically-in-ubuntu-14-04-on-reboot%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      At system reboot, user shiv is not logged in



      Is /home/shiv mounted? Not if you have an encrypted home directory (If /home/shiv/.Private is a link to /home/.ecryptfs/shiv/.Private you do).



      Move (reinstall) the software and data that you have installed underneath /home/shiv to the /usr/local tree (see man hier (hier - description of the filesystem hierarchy).






      share|improve this answer





















      • Hi waltinator. You are right at system reboot shiv user is not logged in. I can't install it again. I am new bie to Ubuntu. So can you please make me understand simply what exactly i have to do to achieve my results.
        – dirtyhandsphp
        Mar 7 '15 at 15:38










      • Do you have sudo access? Type sudo -l, and, when prompted, type YOUR LOGIN PASSWORD. If not, can you get your system administrator to help?
        – waltinator
        Mar 8 '15 at 17:45















      up vote
      0
      down vote













      At system reboot, user shiv is not logged in



      Is /home/shiv mounted? Not if you have an encrypted home directory (If /home/shiv/.Private is a link to /home/.ecryptfs/shiv/.Private you do).



      Move (reinstall) the software and data that you have installed underneath /home/shiv to the /usr/local tree (see man hier (hier - description of the filesystem hierarchy).






      share|improve this answer





















      • Hi waltinator. You are right at system reboot shiv user is not logged in. I can't install it again. I am new bie to Ubuntu. So can you please make me understand simply what exactly i have to do to achieve my results.
        – dirtyhandsphp
        Mar 7 '15 at 15:38










      • Do you have sudo access? Type sudo -l, and, when prompted, type YOUR LOGIN PASSWORD. If not, can you get your system administrator to help?
        – waltinator
        Mar 8 '15 at 17:45













      up vote
      0
      down vote










      up vote
      0
      down vote









      At system reboot, user shiv is not logged in



      Is /home/shiv mounted? Not if you have an encrypted home directory (If /home/shiv/.Private is a link to /home/.ecryptfs/shiv/.Private you do).



      Move (reinstall) the software and data that you have installed underneath /home/shiv to the /usr/local tree (see man hier (hier - description of the filesystem hierarchy).






      share|improve this answer












      At system reboot, user shiv is not logged in



      Is /home/shiv mounted? Not if you have an encrypted home directory (If /home/shiv/.Private is a link to /home/.ecryptfs/shiv/.Private you do).



      Move (reinstall) the software and data that you have installed underneath /home/shiv to the /usr/local tree (see man hier (hier - description of the filesystem hierarchy).







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 7 '15 at 15:28









      waltinator

      21.8k74169




      21.8k74169












      • Hi waltinator. You are right at system reboot shiv user is not logged in. I can't install it again. I am new bie to Ubuntu. So can you please make me understand simply what exactly i have to do to achieve my results.
        – dirtyhandsphp
        Mar 7 '15 at 15:38










      • Do you have sudo access? Type sudo -l, and, when prompted, type YOUR LOGIN PASSWORD. If not, can you get your system administrator to help?
        – waltinator
        Mar 8 '15 at 17:45


















      • Hi waltinator. You are right at system reboot shiv user is not logged in. I can't install it again. I am new bie to Ubuntu. So can you please make me understand simply what exactly i have to do to achieve my results.
        – dirtyhandsphp
        Mar 7 '15 at 15:38










      • Do you have sudo access? Type sudo -l, and, when prompted, type YOUR LOGIN PASSWORD. If not, can you get your system administrator to help?
        – waltinator
        Mar 8 '15 at 17:45
















      Hi waltinator. You are right at system reboot shiv user is not logged in. I can't install it again. I am new bie to Ubuntu. So can you please make me understand simply what exactly i have to do to achieve my results.
      – dirtyhandsphp
      Mar 7 '15 at 15:38




      Hi waltinator. You are right at system reboot shiv user is not logged in. I can't install it again. I am new bie to Ubuntu. So can you please make me understand simply what exactly i have to do to achieve my results.
      – dirtyhandsphp
      Mar 7 '15 at 15:38












      Do you have sudo access? Type sudo -l, and, when prompted, type YOUR LOGIN PASSWORD. If not, can you get your system administrator to help?
      – waltinator
      Mar 8 '15 at 17:45




      Do you have sudo access? Type sudo -l, and, when prompted, type YOUR LOGIN PASSWORD. If not, can you get your system administrator to help?
      – waltinator
      Mar 8 '15 at 17:45












      up vote
      0
      down vote













      Create an Upstart job for your script: http://upstart.ubuntu.com/getting-started.html






      share|improve this answer

























        up vote
        0
        down vote













        Create an Upstart job for your script: http://upstart.ubuntu.com/getting-started.html






        share|improve this answer























          up vote
          0
          down vote










          up vote
          0
          down vote









          Create an Upstart job for your script: http://upstart.ubuntu.com/getting-started.html






          share|improve this answer












          Create an Upstart job for your script: http://upstart.ubuntu.com/getting-started.html







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 15 '15 at 18:59









          warvariuc

          1,51531838




          1,51531838






















              up vote
              0
              down vote













              Open terminal by Crtl+ALT+T and execute following command:



              sudo -H /etc/rc.local


              Add the lines given below to the file but before exit 0.



              sudo /usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc





              share|improve this answer

























                up vote
                0
                down vote













                Open terminal by Crtl+ALT+T and execute following command:



                sudo -H /etc/rc.local


                Add the lines given below to the file but before exit 0.



                sudo /usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc





                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Open terminal by Crtl+ALT+T and execute following command:



                  sudo -H /etc/rc.local


                  Add the lines given below to the file but before exit 0.



                  sudo /usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc





                  share|improve this answer












                  Open terminal by Crtl+ALT+T and execute following command:



                  sudo -H /etc/rc.local


                  Add the lines given below to the file but before exit 0.



                  sudo /usr/bin/python /home/shiv/workspace/CustomOpenERP/openerp-8.0/openerp-server -s -c /home/shiv/.openerp-serverrc






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 15 '15 at 19:11









                  Faizan Akram Dar

                  3,71311528




                  3,71311528






























                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f593857%2fhow-to-run-a-python-script-automatically-in-ubuntu-14-04-on-reboot%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

                      mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

                      How to change which sound is reproduced for terminal bell?

                      Can I use Tabulator js library in my java Spring + Thymeleaf project?