Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-09-2003, 02:29 PM   #1
LQ Newbie
Registered: Oct 2003
Distribution: rh9
Posts: 3

Rep: Reputation: 0
How do I automatically start a program at start up?

I'm new to this linux thing. Anyone has an answer?
Old 10-09-2003, 02:36 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Welcome to LQ.

Try adding the command to:

If it is to run in the background then put a space then an ampersand afetr it " &".

if you want to run a gui app after you have logged in then look at the session configuration for your window manager.
Old 10-09-2003, 03:09 PM   #3
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Rep: Reputation: 30
There are many different ways to run something at startup. I got frustrated a while ago with this same problem (trying to run a couple of X programs at startup) so I just decided to throw this into my .bash_profile:

ses=$(printenv | grep DISPLAY)
if [ -n "$ses" ]; then
'proggies and scripts you wanna run'
it was a pretty workaround at the time, but hey it works, and as the saying goes, if it ain't broke, don't fix it.

Old 10-09-2003, 03:12 PM   #4
Senior Member
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
One way for a GUI app with KDE - just create a symlink from the application itself and put it in


for example -

ln -s /usr/bin/kspread /home/your_username/.kde/Autostart
Old 02-13-2009, 02:30 AM   #5
Registered: Jan 2006
Distribution: gentoo, slackware
Posts: 36

Rep: Reputation: 15
For gnome

The following method is for Gnome;

Last edited by mohdshakir; 07-06-2010 at 04:52 AM. Reason: updating URL
Old 02-15-2009, 11:29 PM   #6
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
this is what i have from my laptop

for /etc/rc.local
# 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
and for /etc/
ifup eth1 &
ifup eth0 &
/sbin/service sshd start &
export http_proxy=localhost:4222
/etc/init.d/cups start &
/etc/init.d/irda start &
/etc/init.d/pcscd start &
/etc/rc.d/init.d/autofs start &
/etc/rc.d/init.d/crond start &
/etc/rc.d/init.d/fuse start &
/etc/rc.d/init.d/netfs start &
/etc/rc.d/init.d/cpuspeed start &
hope you can get idea with this
Old 02-15-2009, 11:42 PM   #7
Registered: Jan 2006
Distribution: gentoo, slackware
Posts: 36

Rep: Reputation: 15
Or try this for KDE:

and this for starting a program even before the login prompt;

Last edited by mohdshakir; 07-06-2010 at 04:54 AM.
Old 10-27-2013, 07:02 AM   #8
LQ Newbie
Registered: Apr 2009
Posts: 6

Rep: Reputation: 1
Don't forget the CRON


I know this is an old thread but I think this is a good place to higlight using CRON for this.

If you use the @reboot cron keyword, this will execute the specified command once every time the machine is booted.

Hope this help someone.

Last edited by AcmeUK; 10-27-2013 at 07:04 AM.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set a program to automatically start wfernley Linux - Newbie 8 04-16-2005 02:20 PM
How do I start a program automatically when KDE starts up? zmaint Linux - Software 8 12-21-2004 05:52 PM
How do I start a program automatically when I boot up? bad_andy Mandriva 2 11-27-2004 09:15 PM
start apps automatically on start up? chunlee Linux - Newbie 3 09-04-2004 01:58 PM
X won't start automatically urinal cake Linux - Newbie 5 03-08-2002 06:54 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration