sameera207
sameera207

Reputation: 16619

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.

  1. I created a run.sh file which will fire up my application (and I check it's working)
  2. I created a symbolic link from both /etc/rc5.d/ and /etc/rc3.d/ to my run.sh file. (A symbolic link is also working fine)

But my processes don't start up when my machine 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).

Upvotes: 2

Views: 1087

Answers (4)

Jithin
Jithin

Reputation: 1195

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.

Upvotes: 0

salezica
salezica

Reputation: 76899

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 :)

Upvotes: 2

Jonathan
Jonathan

Reputation: 13624

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."

Upvotes: 1

Didier Trosset
Didier Trosset

Reputation: 37427

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/.

Upvotes: 1

Related Questions