LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-23-2008, 01:17 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
starting a program automatically at boot up


hi
i need to start some of the programs automatically at boot up.
what should i add in the .bashrc file to do this.
 
Old 01-23-2008, 05:22 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
Lets say you want to start the application 'klipper'.
If you add it to your .bashrc, klipper will be started each time you open a terminal. This is clearly not what you want.
Next, you could use the files .xprofile and .xsession. Just add 'klipper' in one of those files, and you will find klipper starting up each time your X session starts up. This is a decent way to start your program at login.
Lastly, if you want to start a program at bootup instead of login (maybe its a server and not a desktop application), you might want to add it in your /etc/rc.d/rc.local file.

[edit: I'm not near my machine right now, am I mixing up .xprofile with .xinitrc?]

Last edited by indeliblestamp; 01-23-2008 at 05:26 AM.
 
Old 01-23-2008, 06:34 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thank u arun
i wnt to start up different programs for different users when they login .
i dont want to change the /etc (as it will set globally ,right,i am not sure)

as u said entering the programs in .bashrc starts every time i start a new shell.
so i have entered in the .bash_profile and it works fine ,except for one thing

i cannot able to start the shell(/bin/bash) i am using GNOME-2.8.0

[babu@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686 i686 i386 GNU/Linux

distributor is redhat

one more problem is ,before the Desktop(GNOME) gets ready my applications which i have entered in the .bash_profile file gets executed.

is there any way to start a shell at startup which should be the child of GNOME.

Last edited by babu198649; 01-23-2008 at 06:35 AM.
 
Old 01-23-2008, 07:22 AM   #4
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
If I understand your problem correctly, you want to start your terminal emulator (such as gnome-terminal, xterm, rxvt, konsole, etc). Bash will run inside the terminal.
So try with any one of those 4, they're the most common. A terminal should pop up as soon as you login into Gnome then.
Please correct me if I misunderstood.

Also, to load your applications after Gnome is fully loaded, try using the .xsession file.
 
Old 01-23-2008, 07:39 AM   #5
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
Quote:
A terminal should pop up as soon as you login into Gnome then.
thanks for understanding me

Quote:
Also, to load your applications after Gnome is fully loaded,
exactly what i wanted

Quote:
try using the .xsession file.
i have not found any in my home directory.

also i dont wnt the same applications to be started for all the users .different users have different applications to run at startup.
 
Old 01-23-2008, 09:41 AM   #6
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
Oh, glad that bit worked.
I did some googling and discovered that .xsession is primarily used to kick start lightweight window managers (and some applications before the wm itself starts). Apologies, that may not be the appropriate solution for you.
In your case, since you use Gnome, this link has exactly what you need. If you login as each user and follow the steps, you can configure a different set of apps to start for each of them.
 
Old 01-23-2008, 11:50 PM   #7
geek745
Member
 
Registered: Jul 2004
Location: Alton, IL
Distribution: Linux Mint; Slackware; Ubuntu; Slax
Posts: 172
Blog Entries: 2

Rep: Reputation: 34
yeah, use that, and if you need to run as a user, start in command-line mode, login as root, the su to the user account and start gnome from there. that is if you don't have the users around to let you into their account.
 
Old 01-24-2008, 12:03 AM   #8
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thank u for the link
it worked almost the same way as entering the paths in the .bash_profile .ie. both methods starts the applications before the Desktop is fully loaded.

the difference between using .bash_profile and gnome session manager is that the later does not show the splash screen.

how can i find the location of the file in which the gnome session manager records the start applications.
 
Old 01-24-2008, 12:59 AM   #9
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
Sorry, I don't use Gnome so I can't help you with the location. Your best bet is probably digging around in ~/.gnome.
About the apps loading before Gnome fully does, I can suggest a temporary workaround: Say you want to start firefox. Create a shell script in ~/bin or /usr/local/bin (or anywhere in $PATH) called firefox-delayed, and put a sleep for a few seconds in it before running firefox. Give it +x permissions and use it in Gnome's application starter instead of the usual firefox binary.
Of course if someone else here has a better suggestion that would be much better.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically starting a program in a new terminal Uruclef Linux - General 2 05-05-2007 01:46 PM
kde not starting automatically at boot google01103 SUSE / openSUSE 2 12-12-2006 07:19 AM
ypbind is not starting at boot automatically vijayk Linux - Software 1 07-06-2006 06:23 PM
Automatically Starting ypserv on boot kaplan71 Red Hat 1 02-03-2006 05:48 PM
Starting program automatically as logging in adcripps Linux - Newbie 9 03-13-2002 12:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration