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?
boot centos rtorrent
add a comment |
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?
boot centos rtorrent
add a comment |
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?
boot centos rtorrent
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
boot centos rtorrent
edited Nov 16 at 3:32
Worthwelle
2,1832724
2,1832724
asked Nov 14 at 19:39
Abu Stouf
11
11
add a comment |
add a comment |
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.
what bash file? I am sorry I am not great with linux but I am learning.
– Abu Stouf
Nov 14 at 21:32
add a comment |
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.
what bash file? I am sorry I am not great with linux but I am learning.
– Abu Stouf
Nov 14 at 21:32
add a comment |
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.
what bash file? I am sorry I am not great with linux but I am learning.
– Abu Stouf
Nov 14 at 21:32
add a comment |
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.
/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.
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
add a comment |
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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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