How to start applications on X startup

Taking care of your Linux box.

How to start applications on X startup

Postby s7r1k3r » Thu Jul 24, 2003 10:54 pm

Assalam-O-Alaekum!

Can anyone tell me how to start applications when and X GUI starts. I am looking to start applications when GNOME starts. Meaning is there a startup folder replacement (windows) for linux ?

ALLAH HAFIZ.
a10n3 s7r1k3r
s7r1k3r
Battalion Quarter Master Havaldaar
 
Posts: 221
Joined: Wed Aug 07, 2002 3:02 pm
Location: Rawalpindi

Postby Faraz.Fazil » Fri Jul 25, 2003 12:15 am

See this post of mine:
http://www.linuxpakistan.net/forum2x/vi ... .php?t=567

In that post, i told a user how to disable services from starting automatically on linux x startup.

What you want to accomplish is exactly opposite to that users need.


So here we go:
==============
The /etc/init.d directory contains the automatic startup scripts of all the services that start automatically.

So if u want to load a program automatically, just place its startup script in /etc/init.d directoryIf you dont have a startup script you can create one by yourself, by lookng at another startup script, copying it and editing the files with proper paths.This was the difficult method.

An easy method to in redhat linux(im using version 9) is to goto system settings=>server settings=> services

It shows all services.AIt llows u to start stop or restart a service.And also allows u to change service run levels to set it to auto, manual or disabled.

If you set the run level to auto, the service will start automatilcally.

Note: //etc/init.d is a symbolic link that points to /etc/rc.d/init.d
Faraz.Fazil
Major General
 
Posts: 1024
Joined: Thu Jul 04, 2002 5:31 pm
WLM: faraz7476@hotmail.com
Location: Karachi/Pakistan/Earth/Universe

Postby fawad » Fri Jul 25, 2003 2:55 am

s7r1k3r,
There're several ways to do this.
  • Launch it from xinitrc (/etc/X11/xinit/xinitrc or ~/.xinitrc)
  • Launch it at startup of the window manager (GNOME has a configuration area for this (can't recall the exact way to invoke it), so does KDE (Konqueror->Go->Startup and add shortcut to the app there).
fawad
Site Admin
 
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
ICQ: 17672437
Website: http://www.fawad.net
WLM: fawadhalim@hotmail.com
Yahoo Messenger: fawad2048
AOL: fawadhalim
Location: Addison, IL

Buts thats for computer startup.

Postby s7r1k3r » Sat Jul 26, 2003 1:33 am

Assalam-O-Alaekum!

According to my limited knowledge the init.d script method is for starting before X. I want to start a GUI application after GNOME starts. Can this be done with an initd script?

ALLAH HAFIZ.
a10n3 s7r1k3r
s7r1k3r
Battalion Quarter Master Havaldaar
 
Posts: 221
Joined: Wed Aug 07, 2002 3:02 pm
Location: Rawalpindi

Postby fawad » Sat Jul 26, 2003 6:31 am

Look at the 'Sessions' applet in Start Here on Redhat. I use KDE, so can't say for certain.

I was talking about xinitrc which is different from init. xinitrc is invoked by X when starting. When you type startx on the console, x executes the systemwide xinitrc, unless you have a local .xinitrc, which overrides the systemwide one. It usually launched the window manager, although some linux systems launch twm with an xterm.
fawad
Site Admin
 
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
ICQ: 17672437
Website: http://www.fawad.net
WLM: fawadhalim@hotmail.com
Yahoo Messenger: fawad2048
AOL: fawadhalim
Location: Addison, IL

Postby Faraz.Fazil » Sat Jul 26, 2003 8:40 am

Indeed.The init.d method is used to start applications on linux system startup, that is even before the login and x comes up.

If u want to start applications with Xstartup, then,as fawad pointed, use the xinitrc method, which is invoked, as soon as the gui gets invoked.

xinitrc Description: This package contains the basic X windows startup script used by the "startx" command. (from rpm description)
The xinit program is used to start the X Window System server and a first client program on systems.
xinit will look for a file in the user's home directory called .xinitrc to run as a shell script to start up client programs.

Filter list: *|*|*|xinitrc*

Section maint.: SecRobot
Faraz.Fazil
Major General
 
Posts: 1024
Joined: Thu Jul 04, 2002 5:31 pm
WLM: faraz7476@hotmail.com
Location: Karachi/Pakistan/Earth/Universe

Postby Faraz.Fazil » Sun Jul 27, 2003 12:21 pm

Hey guyz, i forgot to tell you guyz one more method:

In terminal, just type:

/usr/bin/redhat-config-services

and press enter

It will invoke the redhat service configurator.It will show u the list of all the services.You can start,stop , restart, enable or disable any service from there.Be careful not to stop or disable any critical process.

Another method to invoke the redhat-config-services is to go to the start menu, server settings and then services.
Faraz.Fazil
Major General
 
Posts: 1024
Joined: Thu Jul 04, 2002 5:31 pm
WLM: faraz7476@hotmail.com
Location: Karachi/Pakistan/Earth/Universe


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 1 guest

cron