Starting a process when Linux starts (Ubuntu)
I have a process (Spark chat client) which needs to be run when my Ubuntu boots up. For this I have done followings.
- I created a run.sh file which will fire up my application (and I check it's working)
- I created a symbolic link from both
/etc/rc5.d/
and/etc/rc3.d/
to myrun.sh
file. (A symbolic link is also working fine)
But my processes don't start up when my m开发者_JAVA百科achine boots. (Is this the way to do it or am I doing the wrong thing here?)
I'm running on Ubuntu 10.04 LTS (Lucid Lynx).
Your solution would've worked in most Linux distributions. However, Ubuntu never goes past runlevel 2.
Just in case, this means the contents of rc?.d
with ? > 2 are not used unless you manually raise the runlevel as root. Use rc2.d :)
The symlinks you created in /etc/rc5.d/
and /etc/rc3.d/
should be named S##name
. S is for start, and the number ## gives an order in which the scripts are run.
Note also that the symlinks in these directories usually points to the actual script located in /etc/init.d/
.
It looks like you want to run an X program when a user logs in, not a service on startup. Remember, in Linux there is no GUI; X is a program that runs to display graphics on the screen.
You likely want to set up a program to start on KDE/Gnome login. Each has their own way to do it, but is generally boils down to pointing at a script and saying "Run this."
Put the command to run that script in the /etc/rc.local
file. I think it will run each time you log in to the system.
精彩评论