CENTOS command won't run on startup











up vote
0
down vote

favorite












I have rtorrent installed and I am trying to run this command so it runs automatically on startup:



screen -S rtorrent -d -m su root -c "rtorrent"


I added it to: nano /etc/rc.local



But nothing seems to happen when I reboot. If I type it in my terminal, it comes up fine without a problem? Why?










share|improve this question




























    up vote
    0
    down vote

    favorite












    I have rtorrent installed and I am trying to run this command so it runs automatically on startup:



    screen -S rtorrent -d -m su root -c "rtorrent"


    I added it to: nano /etc/rc.local



    But nothing seems to happen when I reboot. If I type it in my terminal, it comes up fine without a problem? Why?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have rtorrent installed and I am trying to run this command so it runs automatically on startup:



      screen -S rtorrent -d -m su root -c "rtorrent"


      I added it to: nano /etc/rc.local



      But nothing seems to happen when I reboot. If I type it in my terminal, it comes up fine without a problem? Why?










      share|improve this question















      I have rtorrent installed and I am trying to run this command so it runs automatically on startup:



      screen -S rtorrent -d -m su root -c "rtorrent"


      I added it to: nano /etc/rc.local



      But nothing seems to happen when I reboot. If I type it in my terminal, it comes up fine without a problem? Why?







      boot centos rtorrent






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 at 3:32









      Worthwelle

      2,1832724




      2,1832724










      asked Nov 14 at 19:39









      Abu Stouf

      11




      11






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          /etc/rc.local is used to start services. Services typically do not have any kind of GUI or require any kind of user interaction. If you are expecting rtorrent to bring up some kind of window automatically, before you log in, that will not happen since rtorrent does not know what DISPLAY or tty to use for the display.



          If you want rtorrent to start up automatically when you log in, try putting the rtorrent command into one of your .bash files. Remember though to check if it is already running if you do not want it to be brought up every single time you start a new terminal window or other app that sources in the .bash files.



          Hope this helps.



          UPDATE:



          From https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html




          When Bash is invoked as an interactive login shell, or as a
          non-interactive shell with the --login option, it first reads and
          executes commands from the file /etc/profile, if that file exists.
          After reading that file, it looks for ~/.bash_profile, ~/.bash_login,
          and ~/.profile, in that order, and reads and executes commands from
          the first one that exists and is readable.




          So, if you put your command into your ~/.bash_login file, for example, whenever you log in, whatever is in ~/.bash_login will get executed, including your rtorrent command.



          BTW, ~ stands for your home directory, or ${HOME}, in case you did not know that.






          share|improve this answer























          • what bash file? I am sorry I am not great with linux but I am learning.
            – Abu Stouf
            Nov 14 at 21:32











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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%2fsuperuser.com%2fquestions%2f1375433%2fcentos-command-wont-run-on-startup%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          /etc/rc.local is used to start services. Services typically do not have any kind of GUI or require any kind of user interaction. If you are expecting rtorrent to bring up some kind of window automatically, before you log in, that will not happen since rtorrent does not know what DISPLAY or tty to use for the display.



          If you want rtorrent to start up automatically when you log in, try putting the rtorrent command into one of your .bash files. Remember though to check if it is already running if you do not want it to be brought up every single time you start a new terminal window or other app that sources in the .bash files.



          Hope this helps.



          UPDATE:



          From https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html




          When Bash is invoked as an interactive login shell, or as a
          non-interactive shell with the --login option, it first reads and
          executes commands from the file /etc/profile, if that file exists.
          After reading that file, it looks for ~/.bash_profile, ~/.bash_login,
          and ~/.profile, in that order, and reads and executes commands from
          the first one that exists and is readable.




          So, if you put your command into your ~/.bash_login file, for example, whenever you log in, whatever is in ~/.bash_login will get executed, including your rtorrent command.



          BTW, ~ stands for your home directory, or ${HOME}, in case you did not know that.






          share|improve this answer























          • what bash file? I am sorry I am not great with linux but I am learning.
            – Abu Stouf
            Nov 14 at 21:32















          up vote
          1
          down vote













          /etc/rc.local is used to start services. Services typically do not have any kind of GUI or require any kind of user interaction. If you are expecting rtorrent to bring up some kind of window automatically, before you log in, that will not happen since rtorrent does not know what DISPLAY or tty to use for the display.



          If you want rtorrent to start up automatically when you log in, try putting the rtorrent command into one of your .bash files. Remember though to check if it is already running if you do not want it to be brought up every single time you start a new terminal window or other app that sources in the .bash files.



          Hope this helps.



          UPDATE:



          From https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html




          When Bash is invoked as an interactive login shell, or as a
          non-interactive shell with the --login option, it first reads and
          executes commands from the file /etc/profile, if that file exists.
          After reading that file, it looks for ~/.bash_profile, ~/.bash_login,
          and ~/.profile, in that order, and reads and executes commands from
          the first one that exists and is readable.




          So, if you put your command into your ~/.bash_login file, for example, whenever you log in, whatever is in ~/.bash_login will get executed, including your rtorrent command.



          BTW, ~ stands for your home directory, or ${HOME}, in case you did not know that.






          share|improve this answer























          • what bash file? I am sorry I am not great with linux but I am learning.
            – Abu Stouf
            Nov 14 at 21:32













          up vote
          1
          down vote










          up vote
          1
          down vote









          /etc/rc.local is used to start services. Services typically do not have any kind of GUI or require any kind of user interaction. If you are expecting rtorrent to bring up some kind of window automatically, before you log in, that will not happen since rtorrent does not know what DISPLAY or tty to use for the display.



          If you want rtorrent to start up automatically when you log in, try putting the rtorrent command into one of your .bash files. Remember though to check if it is already running if you do not want it to be brought up every single time you start a new terminal window or other app that sources in the .bash files.



          Hope this helps.



          UPDATE:



          From https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html




          When Bash is invoked as an interactive login shell, or as a
          non-interactive shell with the --login option, it first reads and
          executes commands from the file /etc/profile, if that file exists.
          After reading that file, it looks for ~/.bash_profile, ~/.bash_login,
          and ~/.profile, in that order, and reads and executes commands from
          the first one that exists and is readable.




          So, if you put your command into your ~/.bash_login file, for example, whenever you log in, whatever is in ~/.bash_login will get executed, including your rtorrent command.



          BTW, ~ stands for your home directory, or ${HOME}, in case you did not know that.






          share|improve this answer














          /etc/rc.local is used to start services. Services typically do not have any kind of GUI or require any kind of user interaction. If you are expecting rtorrent to bring up some kind of window automatically, before you log in, that will not happen since rtorrent does not know what DISPLAY or tty to use for the display.



          If you want rtorrent to start up automatically when you log in, try putting the rtorrent command into one of your .bash files. Remember though to check if it is already running if you do not want it to be brought up every single time you start a new terminal window or other app that sources in the .bash files.



          Hope this helps.



          UPDATE:



          From https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html




          When Bash is invoked as an interactive login shell, or as a
          non-interactive shell with the --login option, it first reads and
          executes commands from the file /etc/profile, if that file exists.
          After reading that file, it looks for ~/.bash_profile, ~/.bash_login,
          and ~/.profile, in that order, and reads and executes commands from
          the first one that exists and is readable.




          So, if you put your command into your ~/.bash_login file, for example, whenever you log in, whatever is in ~/.bash_login will get executed, including your rtorrent command.



          BTW, ~ stands for your home directory, or ${HOME}, in case you did not know that.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 15 at 13:25

























          answered Nov 14 at 20:35









          Lewis M

          2925




          2925












          • what bash file? I am sorry I am not great with linux but I am learning.
            – Abu Stouf
            Nov 14 at 21:32


















          • what bash file? I am sorry I am not great with linux but I am learning.
            – Abu Stouf
            Nov 14 at 21:32
















          what bash file? I am sorry I am not great with linux but I am learning.
          – Abu Stouf
          Nov 14 at 21:32




          what bash file? I am sorry I am not great with linux but I am learning.
          – Abu Stouf
          Nov 14 at 21:32


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375433%2fcentos-command-wont-run-on-startup%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

          Plaza Victoria

          Puebla de Zaragoza

          Musa