Results 1 to 8 of 8
Hi, guys!
How to start a program at system startup? Just add a line in some system configuration file? Or is there a way other than this?...
- 12-07-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 21
Start a program at system startup
Hi, guys!
How to start a program at system startup? Just add a line in some system configuration file? Or is there a way other than this?
- 12-07-2008 #2
try googling "Linux configure your sessions"...Hope this helps or try this link
Configuring Sessions (GNOME 2.2 Desktop on Linux User Guide) - Sun Microsystems
- 12-07-2008 #3Linux User
- Join Date
- Mar 2008
- Posts
- 287
Would using "cron" help? Probably could initiate from .bashrc too.
- 12-07-2008 #4How to start a program at system startup?No, he's interested in doing something at system startup, not when he starts a session.try googling "Linux configure your sessions.
No, he's interested in doing something at system startup, not at a particular point in clock time.Would using "cron" help?
No, he's interested in doing something at system startup, not when he fires up a new bash shell.Probably could initiate from .bashrc
The answer depends on your particular Linux distribution. Linux distributions have various ways of organizing their startup files.
For example, in Slackware (which is what I run), you'd probably want to place your startup code in /etc/rc.d/rc.local, but if the desired program is to be run continuously, even while the rest of the system is running, make sure you have an amperstand at the end of the line:
or the initialization won't continue until the program is finished. Nobody likes his system to take an infinite time to boot up.Code:asdf asdf qwerty &
Also, since the program will be running at system startup, it will be run before anyone logs in. This means that it will run as root, and won't have most of the normal environment variables set, such as a home directory.
Consult the documentation for your particular distribution. Maybe, if you say in this thread which distribution you're using, someone will come along and say which file you should modify.
Hope this helps.--
Bill
Old age and treachery will overcome youth and skill.
- 12-08-2008 #5Just Joined!
- Join Date
- Feb 2008
- Posts
- 21
I still cannot figure out. I'm using Ubuntu. Can anyone help?
- 12-08-2008 #6
Yeah, my wife runs Ubuntu. The file in question is
If you use vi, you need to do this:Code:/etc/rc.d
If whatever you put in there is something which could run a long time, so you don't want to wait for it to finish before continuing the boot process, be sure to put the ampersand (&) at the end of the command, or you system might not make it all the way up. It might just be running your program forever.Code:sudo vi /etc/rc.d
--
Bill
Old age and treachery will overcome youth and skill.
- 12-08-2008 #7
Oops! My bad! Not /etc/rc.d, but /etc/rc.local
Sorry for the confusion. :(--
Bill
Old age and treachery will overcome youth and skill.
- 12-08-2008 #8Just Joined!
- Join Date
- Feb 2008
- Posts
- 21
I made it. The original mistake is that I forgot to write the full path name in rc.local. Thanks!


Reply With Quote