Operating System - Linux
1819866 Members
2535 Online
109607 Solutions
New Discussion юеВ

whts the diff b/w 'startx' and 'init 5'

 
SOLVED
Go to solution
Sharfuddin
Frequent Advisor

whts the diff b/w 'startx' and 'init 5'

Hi to All
what is the difference between "init 5" and "startx". which command(either "init 5" or "startx") should I issue to run X-server so that i can work in GUI environment.
Thanks in anticipation

Regards
Sharf
4 REPLIES 4
Claudio Cilloni
Honored Contributor
Solution

Re: whts the diff b/w 'startx' and 'init 5'

'startx' is a script that only runs the X server. 'init 5' sets the run-level of the machine to 5, that means the execution of all the programs/services that are assigned to the level 5; the X server is one of these.

hth,
Claudio
Mark Grant
Honored Contributor

Re: whts the diff b/w 'startx' and 'init 5'

Calaudio has described this well but I'd like to expand it a bit.

A unix system is bought up by changing to a specific run-level. /etc/inittab describes thes e run levels and some applications to start up to be "monitored" by "init". Shutting down is really changing to run level 0.

Standard unix system decided run level 3 would be "start everything required to get a multi-user, networked environment". I think it was Red Hat who decided a simple way of getting the X login box up was to say "lets make a run level 5 that starts xdm/gdm/kdm and make that the default"

This start the xdm application which is a log in box which sets up an X environment when you login and runs the system wide Xsession file.

When you dont use the inittab approach to starting xdm, you run "startx". This is a script that starts the X server and does what the X login would do but without the logging in.

You have another option "xinit" which is basically the simplest way of starting. This way is nice because you can pass arguments to your personal .xsession file thus changing which X environment you atrt up in. You can do it with the other ways too but it's more irritating.

My preferred method is not to use /etc/inittab but to put "kdm" in a start up script in /sbin/init.d. This is more unixy.

Apologies for the lengthy reply I just happen to like X :)
Never preceed any demonstration with anything more predictive than "watch this"
Sharfuddin
Frequent Advisor

Re: whts the diff b/w 'startx' and 'init 5'

Hi U Great Peoples
Thanx Claudio for such a precoius reply.
And U Great Mark, I so thankfull to u for for such explanatory reply
Thanks U great ones
Claudio Cilloni
Honored Contributor

Re: whts the diff b/w 'startx' and 'init 5'

Yes Mark, this kind of question deserves a longer answer. Sometimes I have no time to give better reply... Thanks for your support :-)

Ciao
Claudio