I want to start an application when the linux or unix starts every time, it is said I have to modify the /etc/rc.local, I am a newbie, I don't know exactly, could anyone give me some help or sample code. Thanks in advance!
Printable View
I want to start an application when the linux or unix starts every time, it is said I have to modify the /etc/rc.local, I am a newbie, I don't know exactly, could anyone give me some help or sample code. Thanks in advance!
what distro, there are a few differnt mechanismt for handleing this.
yeah most common way just add the path of your application in /etc/rc.local file
eg. if i want to run a shell script named "masq" (which is in /opt) everytime system bootsup i will add a line below this example text (default in RED HAT 9)
######################example file in RHL 9 #####################
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
################################################## ###########
Now the file look like:
######################Modified file in RHL 9 #####################
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/opt/masq
################################################## ###########
thats all it will work..................................... :D
Some applications you may only want to start when a user logs in, not when the puter actually starts. You put those in ~/.bashrc or ~/.kde/autostart
Jeremy