How to run a program on boot up?
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
So I have this program which I manually run as root :
sudo gammu-smsd -c /etc/gammu-smsdrc -d
What this does is it runs the Gammu (software to manage gsm modems) and 'daemonize' it. My problem is I want this program to automatically run on boot up .
Is it ok to just edit root's crontab and stick this command there? Or there's some other way?
(Im using Ubuntu 11.04.)
linux boot init-script
migrated from stackoverflow.com Sep 28 '11 at 10:32
This question came from our site for professional and enthusiast programmers.
add a comment |Â
up vote
5
down vote
favorite
So I have this program which I manually run as root :
sudo gammu-smsd -c /etc/gammu-smsdrc -d
What this does is it runs the Gammu (software to manage gsm modems) and 'daemonize' it. My problem is I want this program to automatically run on boot up .
Is it ok to just edit root's crontab and stick this command there? Or there's some other way?
(Im using Ubuntu 11.04.)
linux boot init-script
migrated from stackoverflow.com Sep 28 '11 at 10:32
This question came from our site for professional and enthusiast programmers.
1
You probably don't need the sudo when you put it in the startup files since most stuff there is executed by root.
â Johan
Sep 28 '11 at 10:38
You might first ask yourself if you want that to be run before or after a user logs in.
â rozcietrzewiacz
Sep 28 '11 at 11:02
1
It maybe worth looking at creating init.d scripts for your daemon, However your requirement so up to you.
â whoami
Sep 28 '11 at 11:07
I would like to run before a user logs in. The thing is I want my server to run my programs (not just gammu) even if im not around during a power failure in which the computer reboots.
â r2b2
Sep 28 '11 at 14:30
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
So I have this program which I manually run as root :
sudo gammu-smsd -c /etc/gammu-smsdrc -d
What this does is it runs the Gammu (software to manage gsm modems) and 'daemonize' it. My problem is I want this program to automatically run on boot up .
Is it ok to just edit root's crontab and stick this command there? Or there's some other way?
(Im using Ubuntu 11.04.)
linux boot init-script
So I have this program which I manually run as root :
sudo gammu-smsd -c /etc/gammu-smsdrc -d
What this does is it runs the Gammu (software to manage gsm modems) and 'daemonize' it. My problem is I want this program to automatically run on boot up .
Is it ok to just edit root's crontab and stick this command there? Or there's some other way?
(Im using Ubuntu 11.04.)
linux boot init-script
linux boot init-script
edited Sep 28 '11 at 11:41
Stéphane Gimenez
18.8k15074
18.8k15074
asked Sep 28 '11 at 9:35
r2b2
143126
143126
migrated from stackoverflow.com Sep 28 '11 at 10:32
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Sep 28 '11 at 10:32
This question came from our site for professional and enthusiast programmers.
1
You probably don't need the sudo when you put it in the startup files since most stuff there is executed by root.
â Johan
Sep 28 '11 at 10:38
You might first ask yourself if you want that to be run before or after a user logs in.
â rozcietrzewiacz
Sep 28 '11 at 11:02
1
It maybe worth looking at creating init.d scripts for your daemon, However your requirement so up to you.
â whoami
Sep 28 '11 at 11:07
I would like to run before a user logs in. The thing is I want my server to run my programs (not just gammu) even if im not around during a power failure in which the computer reboots.
â r2b2
Sep 28 '11 at 14:30
add a comment |Â
1
You probably don't need the sudo when you put it in the startup files since most stuff there is executed by root.
â Johan
Sep 28 '11 at 10:38
You might first ask yourself if you want that to be run before or after a user logs in.
â rozcietrzewiacz
Sep 28 '11 at 11:02
1
It maybe worth looking at creating init.d scripts for your daemon, However your requirement so up to you.
â whoami
Sep 28 '11 at 11:07
I would like to run before a user logs in. The thing is I want my server to run my programs (not just gammu) even if im not around during a power failure in which the computer reboots.
â r2b2
Sep 28 '11 at 14:30
1
1
You probably don't need the sudo when you put it in the startup files since most stuff there is executed by root.
â Johan
Sep 28 '11 at 10:38
You probably don't need the sudo when you put it in the startup files since most stuff there is executed by root.
â Johan
Sep 28 '11 at 10:38
You might first ask yourself if you want that to be run before or after a user logs in.
â rozcietrzewiacz
Sep 28 '11 at 11:02
You might first ask yourself if you want that to be run before or after a user logs in.
â rozcietrzewiacz
Sep 28 '11 at 11:02
1
1
It maybe worth looking at creating init.d scripts for your daemon, However your requirement so up to you.
â whoami
Sep 28 '11 at 11:07
It maybe worth looking at creating init.d scripts for your daemon, However your requirement so up to you.
â whoami
Sep 28 '11 at 11:07
I would like to run before a user logs in. The thing is I want my server to run my programs (not just gammu) even if im not around during a power failure in which the computer reboots.
â r2b2
Sep 28 '11 at 14:30
I would like to run before a user logs in. The thing is I want my server to run my programs (not just gammu) even if im not around during a power failure in which the computer reboots.
â r2b2
Sep 28 '11 at 14:30
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
6
down vote
accepted
How about /etc/rc.local?
This will be executed last in the startup sequence.
addsleep 1m
beforegammu-smsd -d
. I know this is not recommended, but this is the easy way to make it working. You might need also look for creating init.d script
â GusDeCooL
May 15 '13 at 16:50
add a comment |Â
up vote
0
down vote
Here is how on how to add a startup script to be run at bootup. You can find more information here.
1
The link you gave is very outdated. From what I know, the booting procedure has much changed since.
â rozcietrzewiacz
Sep 28 '11 at 11:00
add a comment |Â
up vote
0
down vote
May this help you ?
http://www.howtogeek.com/howto/ubuntu/how-to-add-a-program-to-the-ubuntu-startup-list-after-login/
Or just add it in the /etc/profile
or do add it the recommended way : http://embraceubuntu.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/
Indeed, remove the sudo !
(but you will need it to do the edit or to add the command, so...)
1
it executes the program after the login, i was hoping something that gets executed before that, or during the login window is shown ,or without needing to login
â r2b2
Sep 28 '11 at 9:49
see my edit : add it in the system-wide startup file
â Louis
Sep 28 '11 at 10:01
Louis: do I need to removesudo
if i follow that guide?
â r2b2
Sep 28 '11 at 14:23
add a comment |Â
up vote
0
down vote
You can use crontab for this.
Use crontab -e
to edit user's crontab (A list of start-up scripts that users have added).
Add following line at the end:
@reboot <command>
Examples:
@reboot my_script.sh
@reboot python my_script.py arg1 arg2
Finally use contab -l
to make sure your script was added to the list.
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
How about /etc/rc.local?
This will be executed last in the startup sequence.
addsleep 1m
beforegammu-smsd -d
. I know this is not recommended, but this is the easy way to make it working. You might need also look for creating init.d script
â GusDeCooL
May 15 '13 at 16:50
add a comment |Â
up vote
6
down vote
accepted
How about /etc/rc.local?
This will be executed last in the startup sequence.
addsleep 1m
beforegammu-smsd -d
. I know this is not recommended, but this is the easy way to make it working. You might need also look for creating init.d script
â GusDeCooL
May 15 '13 at 16:50
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
How about /etc/rc.local?
This will be executed last in the startup sequence.
How about /etc/rc.local?
This will be executed last in the startup sequence.
answered Sep 28 '11 at 10:40
Johan
3,15411628
3,15411628
addsleep 1m
beforegammu-smsd -d
. I know this is not recommended, but this is the easy way to make it working. You might need also look for creating init.d script
â GusDeCooL
May 15 '13 at 16:50
add a comment |Â
addsleep 1m
beforegammu-smsd -d
. I know this is not recommended, but this is the easy way to make it working. You might need also look for creating init.d script
â GusDeCooL
May 15 '13 at 16:50
add
sleep 1m
before gammu-smsd -d
. I know this is not recommended, but this is the easy way to make it working. You might need also look for creating init.d scriptâ GusDeCooL
May 15 '13 at 16:50
add
sleep 1m
before gammu-smsd -d
. I know this is not recommended, but this is the easy way to make it working. You might need also look for creating init.d scriptâ GusDeCooL
May 15 '13 at 16:50
add a comment |Â
up vote
0
down vote
Here is how on how to add a startup script to be run at bootup. You can find more information here.
1
The link you gave is very outdated. From what I know, the booting procedure has much changed since.
â rozcietrzewiacz
Sep 28 '11 at 11:00
add a comment |Â
up vote
0
down vote
Here is how on how to add a startup script to be run at bootup. You can find more information here.
1
The link you gave is very outdated. From what I know, the booting procedure has much changed since.
â rozcietrzewiacz
Sep 28 '11 at 11:00
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Here is how on how to add a startup script to be run at bootup. You can find more information here.
Here is how on how to add a startup script to be run at bootup. You can find more information here.
answered Sep 28 '11 at 10:25
Praveen Sripati
1214
1214
1
The link you gave is very outdated. From what I know, the booting procedure has much changed since.
â rozcietrzewiacz
Sep 28 '11 at 11:00
add a comment |Â
1
The link you gave is very outdated. From what I know, the booting procedure has much changed since.
â rozcietrzewiacz
Sep 28 '11 at 11:00
1
1
The link you gave is very outdated. From what I know, the booting procedure has much changed since.
â rozcietrzewiacz
Sep 28 '11 at 11:00
The link you gave is very outdated. From what I know, the booting procedure has much changed since.
â rozcietrzewiacz
Sep 28 '11 at 11:00
add a comment |Â
up vote
0
down vote
May this help you ?
http://www.howtogeek.com/howto/ubuntu/how-to-add-a-program-to-the-ubuntu-startup-list-after-login/
Or just add it in the /etc/profile
or do add it the recommended way : http://embraceubuntu.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/
Indeed, remove the sudo !
(but you will need it to do the edit or to add the command, so...)
1
it executes the program after the login, i was hoping something that gets executed before that, or during the login window is shown ,or without needing to login
â r2b2
Sep 28 '11 at 9:49
see my edit : add it in the system-wide startup file
â Louis
Sep 28 '11 at 10:01
Louis: do I need to removesudo
if i follow that guide?
â r2b2
Sep 28 '11 at 14:23
add a comment |Â
up vote
0
down vote
May this help you ?
http://www.howtogeek.com/howto/ubuntu/how-to-add-a-program-to-the-ubuntu-startup-list-after-login/
Or just add it in the /etc/profile
or do add it the recommended way : http://embraceubuntu.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/
Indeed, remove the sudo !
(but you will need it to do the edit or to add the command, so...)
1
it executes the program after the login, i was hoping something that gets executed before that, or during the login window is shown ,or without needing to login
â r2b2
Sep 28 '11 at 9:49
see my edit : add it in the system-wide startup file
â Louis
Sep 28 '11 at 10:01
Louis: do I need to removesudo
if i follow that guide?
â r2b2
Sep 28 '11 at 14:23
add a comment |Â
up vote
0
down vote
up vote
0
down vote
May this help you ?
http://www.howtogeek.com/howto/ubuntu/how-to-add-a-program-to-the-ubuntu-startup-list-after-login/
Or just add it in the /etc/profile
or do add it the recommended way : http://embraceubuntu.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/
Indeed, remove the sudo !
(but you will need it to do the edit or to add the command, so...)
May this help you ?
http://www.howtogeek.com/howto/ubuntu/how-to-add-a-program-to-the-ubuntu-startup-list-after-login/
Or just add it in the /etc/profile
or do add it the recommended way : http://embraceubuntu.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/
Indeed, remove the sudo !
(but you will need it to do the edit or to add the command, so...)
edited Sep 28 '11 at 20:00
Communityâ¦
1
1
answered Sep 28 '11 at 9:39
Louis
1012
1012
1
it executes the program after the login, i was hoping something that gets executed before that, or during the login window is shown ,or without needing to login
â r2b2
Sep 28 '11 at 9:49
see my edit : add it in the system-wide startup file
â Louis
Sep 28 '11 at 10:01
Louis: do I need to removesudo
if i follow that guide?
â r2b2
Sep 28 '11 at 14:23
add a comment |Â
1
it executes the program after the login, i was hoping something that gets executed before that, or during the login window is shown ,or without needing to login
â r2b2
Sep 28 '11 at 9:49
see my edit : add it in the system-wide startup file
â Louis
Sep 28 '11 at 10:01
Louis: do I need to removesudo
if i follow that guide?
â r2b2
Sep 28 '11 at 14:23
1
1
it executes the program after the login, i was hoping something that gets executed before that, or during the login window is shown ,or without needing to login
â r2b2
Sep 28 '11 at 9:49
it executes the program after the login, i was hoping something that gets executed before that, or during the login window is shown ,or without needing to login
â r2b2
Sep 28 '11 at 9:49
see my edit : add it in the system-wide startup file
â Louis
Sep 28 '11 at 10:01
see my edit : add it in the system-wide startup file
â Louis
Sep 28 '11 at 10:01
Louis: do I need to remove
sudo
if i follow that guide?â r2b2
Sep 28 '11 at 14:23
Louis: do I need to remove
sudo
if i follow that guide?â r2b2
Sep 28 '11 at 14:23
add a comment |Â
up vote
0
down vote
You can use crontab for this.
Use crontab -e
to edit user's crontab (A list of start-up scripts that users have added).
Add following line at the end:
@reboot <command>
Examples:
@reboot my_script.sh
@reboot python my_script.py arg1 arg2
Finally use contab -l
to make sure your script was added to the list.
add a comment |Â
up vote
0
down vote
You can use crontab for this.
Use crontab -e
to edit user's crontab (A list of start-up scripts that users have added).
Add following line at the end:
@reboot <command>
Examples:
@reboot my_script.sh
@reboot python my_script.py arg1 arg2
Finally use contab -l
to make sure your script was added to the list.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can use crontab for this.
Use crontab -e
to edit user's crontab (A list of start-up scripts that users have added).
Add following line at the end:
@reboot <command>
Examples:
@reboot my_script.sh
@reboot python my_script.py arg1 arg2
Finally use contab -l
to make sure your script was added to the list.
You can use crontab for this.
Use crontab -e
to edit user's crontab (A list of start-up scripts that users have added).
Add following line at the end:
@reboot <command>
Examples:
@reboot my_script.sh
@reboot python my_script.py arg1 arg2
Finally use contab -l
to make sure your script was added to the list.
answered yesterday
Jithin Pavithran
1185
1185
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f21593%2fhow-to-run-a-program-on-boot-up%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
You probably don't need the sudo when you put it in the startup files since most stuff there is executed by root.
â Johan
Sep 28 '11 at 10:38
You might first ask yourself if you want that to be run before or after a user logs in.
â rozcietrzewiacz
Sep 28 '11 at 11:02
1
It maybe worth looking at creating init.d scripts for your daemon, However your requirement so up to you.
â whoami
Sep 28 '11 at 11:07
I would like to run before a user logs in. The thing is I want my server to run my programs (not just gammu) even if im not around during a power failure in which the computer reboots.
â r2b2
Sep 28 '11 at 14:30