script file
Hi i am very new to linux, (i have ubantu) and would like to start a program when the pc boots.
What i found out so far is to put a command in /etc/rcS.d Am i right? if so, how shall i write the command? |
Read the man pages on inittab.
from inittab, you eventually get to the links in the various rc files. prefix "K" means kill when entering this runlevel, and "S" means start. The files link to scripts in /etc/init.d, but they can also be just links to basic commands. Various books have a complete narrative on the whole init process. There is probably also an online tutorial. |
dup post--sorry
|
Sorry but can you explain in detail, as I only had linux for 3 days, and only know a little.
|
If you are not root, run:
Code:
sudo bash Code:
cp script /etc/init.d/script |
ok, i understood that but what shall i write in the script.
|
For general purpose tasks, there is /etc/rc.local or as in SuSE, /etc/rc.d/boot.local.
This file is executed at the boot time, just before the system becomes ready to use. All resources are ready at time this file is executed. You can call any scripts you want here. The scripts at /etc/init.d/rc<n>.d/ are symbolic links to files on /etc/init.d/ and they follow a strict convention about syntax, dependencies about another services, special comments in the header of file used by programs like chkconfig. They are used to start/stop daemons for several services. My advice is to put any local stuff to rc.local or whatever it is the name in your system. I hope this can help, |
All times are GMT -5. The time now is 10:32 PM. |