LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 10-09-2003, 01:29 PM   #1
victordh
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, 01:36 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Welcome to LQ.

Try adding the command to:
/etc/rc.d/rc.local

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, 02:09 PM   #3
slightcrazed
Member
 
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:

Code:
ses=$(printenv | grep DISPLAY)
if [ -n "$ses" ]; then
'proggies and scripts you wanna run'
fi
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.

slight
 
Old 10-09-2003, 02:12 PM   #4
Skyline
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

/home/your_username/.kde/Autostart

for example -

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

Rep: Reputation: 15
For gnome

The following method is for Gnome;
http://www.techrecipes.net/applicati...ram-on-startup

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

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

for /etc/rc.local
Code:
#!/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
/etc/startup.sh
and for /etc/startup.sh
Code:
#!bin/sh
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, 10:42 PM   #7
mohdshakir
Member
 
Registered: Jan 2006
Distribution: gentoo, slackware
Posts: 36

Rep: Reputation: 15
Or try this for KDE:
http://www.techrecipes.net/applicati...ram-on-startup

and this for starting a program even before the login prompt;
http://www.techrecipes.net/operating...ram-on-startup

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

Rep: Reputation: 0
Don't forget the CRON

Hi

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 06:04 AM.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 01:20 PM
How do I start a program automatically when KDE starts up? zmaint Linux - Software 8 12-21-2004 04:52 PM
How do I start a program automatically when I boot up? bad_andy Mandriva 2 11-27-2004 08:15 PM
start apps automatically on start up? chunlee Linux - Newbie 3 09-04-2004 12:58 PM
X won't start automatically urinal cake Linux - Newbie 5 03-08-2002 05:54 PM


All times are GMT -5. The time now is 03:25 AM.

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