-   Linux - Newbie (
-   -   launching an application when X starts... (

DKnight 06-07-2003 10:48 AM

launching an application when X starts...
When I modify .bash_profile to auto start gkrellm when I log into X as such :

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc

# User specific environment and startup programs


export PATH

gkrellm appears but nothing else loads in X (panels, background, icons, NOTHING ... ) UNTIL I close/exit gkrellm at which point everything loads up as usual. :scratch:

Is there a way to run this 'out of process' so that the load-up doesn't wait for the application I'm asking it to launch to *terminate* before continuing with the load process?

The short and the long of it is that I just want to be able to log into X and have my environment load as usual and a few custom programs I keep in the background to also automatically load and persist.

I have spent the last 3 hours researching this little thing, I was mostly sane when I started ... but it's personal now so I *will* find a way. Any help would likely enable me to avoid an aneurysm and would of course be appreciated!

I'm running gnome under redhat 9.0 w/ kernel 2.4.20-18.9


KevB 06-07-2003 10:50 AM

Add, /sbin/gkrellm

To .xinitrc ?

DKnight 06-07-2003 11:02 AM

adding /sbin/gkrellm to the end of file /etc/X11/xinit/xinitrc had no effect, even upon reboot.

In a moment of paranoia I also tested /sbin/gkrellm at the command line to make sure that it does launch gkrellm.

Any other suggestions?

KevB 06-07-2003 02:35 PM

The file ".xinitrc" should be in your home directory, minus the quotes but including the period (it's a hidden file).

You can list hidden files with "ls -a".

If it doesn't exist just create it with your favourite text editor.


DKnight 06-07-2003 06:51 PM

First off, thanks for the help!

I tried placing it in a file I created in my home directory and named it .xinitrc the contents where only one line :


This had no effect. I suspect it was not even run during X11 startup. Any ideas why this might be?

nakkaya 06-07-2003 07:09 PM

/sbin is for sytem spesific programs like gnu parted makefs. gkrellm should be in /usr/bin
if it is not there use whereis is command to find it the add it to .xinitrc here is a copy of mine

exec xscreensaver&
exec gkrellm&
exec /usr/X11R6/bin/fluxbox

DKnight 06-07-2003 08:33 PM

Created a file named .xinitrc in the home directory of the user I'm logging in as and added the following line:

exec gkrellm&

but it doesn't do all...kinda odd.

I decided to try adding the same line to the end of the xinitrc found in


and it similarly did absolutely nothing ... :cry: ... are these files called when X is started up or when the system is rebooted?

Any other thoughts... I'm going to reboot btw, with both those files modified just for paranoia sake...

Thanks for the help nakkaya

padlamoij 06-07-2003 09:50 PM

did you move gkrellm into /usr/bin/ and out of /sbin/? sbin is not in your $PATH if you are not the root user i believe. and you don't have privliges(yikes sp!) to run programs from that directory if you are a user(not root). you need to move it into /usr/bin.

to test to see if X is reading the .xinitrc file at all add something like:

exec xterm &

and if you get an xterm window at startup then you know that it is reading the .xinitrc file and it is likely that it is the issue i described above. hope this helps.

DKnight 06-07-2003 10:01 PM

Yep I moved it and now it is globally launchable by name which is nice . I'm testing your .xinitrc suggestion now.

DKnight 06-07-2003 10:04 PM

Nope, it doesn't seem to be reading the local .xinitrc file from my users directory.


DKnight 06-07-2003 10:15 PM

BTW, changing the /sbin/gkrellm line in my first post to:

exec gkrellm &

(after relocating gkrellm to /usr/bin) did the trick in so far as launching gkrellm at runlevel 5 signon. Thank you all for your help!!

I would still like to know how to get my local .xinitrc working though... assuming the local copy is even supposed to exist in RH9 's implementation. Lets call it intellectual curiosity. :D

??:study: ??

padlamoij 06-07-2003 11:43 PM

i'm pretty sure you need to look into .xsession. i think there is a config script or something to edit it. don't really know the full details though.

KevB 06-08-2003 04:50 AM


Originally posted by DKnight
I would still like to know how to get my local .xinitrc working though...
Only just noticed you are using Gnome, this may well use a different method. I've used .xinitrc with Fluxbox and Blackbox and it works fine. It's covered in the documentation at, but it's not Fluxbox specific (.xinitrc). Maybe Gnome or RH has replaced it?

DKnight 06-08-2003 07:43 AM

I suspect you're right KevB, I'm going to research it some more in the RH manuals and if I come up with a definitive answer I'll be sure to post it so others can possibly benefit ...

All times are GMT -5. The time now is 12:15 PM.