LinuxQuestions.org
Review your favorite Linux distribution.
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 03-05-2009, 07:13 AM   #1
davidhk
Member
 
Registered: Jun 2005
Posts: 38

Rep: Reputation: 15
different between init 5 and startx from init 3


My box was init 3 at my startup. What is the different if switch to init 5 and startx from init 3 . Did they the same? If diff, which one is the best to save my resources?
 
Old 03-05-2009, 07:29 AM   #2
healyma
Member
 
Registered: Feb 2009
Location: Mayo, Ireland
Distribution: LFS 6.4; Debian 5.4; Mythbuntu & Kubuntu 10.04
Posts: 49

Rep: Reputation: 19
Hi,
the different run-levels start different apps/services etc based on the executable contents of their corressponding folder. so if you have a default run-level of 3 and then startx - you will have simply started X, whereas, if you change the run-level to 5, there may be additional processes which are also started.

One quick way to find out is to examine the contents of /etc/rc.d/rc.3 and /etc/rc.d/rc.5 - also there is nothing really stopping you from adding a link to startx in rc.3

Mark
 
Old 03-05-2009, 08:21 AM   #3
davidhk
Member
 
Registered: Jun 2005
Posts: 38

Original Poster
Rep: Reputation: 15
so run-level to 3 and then startx, must be better to save resources.
 
Old 03-05-2009, 08:26 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by davidhk View Post
so run-level to 3 and then startx, must be better to save resources.
I don't know how you came to that conclusion....
First, what resources are you trying to save? CPU cycles? RAM? disk space.

Try this: in each runlevel, run "top" and see what the resource usage is.
 
Old 03-05-2009, 08:35 AM   #5
davidhk
Member
 
Registered: Jun 2005
Posts: 38

Original Poster
Rep: Reputation: 15
I mean "ram", bcos some may be eaten by "additional processes" in init 5. Am I right?
 
Old 03-05-2009, 08:51 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by davidhk View Post
I mean "ram", bcos some may be eaten by "additional processes" in init 5. Am I right?
It depends on what the process is---n'est-ce pas?

Looking in the init scripts, rc.d, etc. + running "top" will help you answer your own question. regardless of runlevel, you may want to customize your startup scripts.
 
Old 03-05-2009, 09:04 AM   #7
healyma
Member
 
Registered: Feb 2009
Location: Mayo, Ireland
Distribution: LFS 6.4; Debian 5.4; Mythbuntu & Kubuntu 10.04
Posts: 49

Rep: Reputation: 19
Quote:
Originally Posted by healyma View Post
Hi,
if you change the run-level to 5, there may be additional processes which are also started.
Should have clarified this at the time, basically each run-level has different associated processes. Initially, after installing a distribution, run-level 5 will include everything in run-level 3 plus the X environment, but this is not always the case - it varies between distributions and some software might only run automatically in one run-level.

As pixellany suggests, the simpliest and surest way to ensure that you are not placing any undue burden on resoures is to examine the contents of both directories. You may find processes in both which do not need to be run.

Mark
 
Old 03-05-2009, 04:51 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
It's true that this entirely depends on the distro, you might find distros where runlevels 4 and 5 are not even configured by default, and are equivalent to 3. But in a typical distro where 5 equals to graphical login, your assumption is basically true. The difference might not be big, but it exists nonetheless.

The main difference (if we forget about any other specific service that's started in 5, if any) is how do we login. When we login in console on 3 we tipically use agetty, mingetty or the like. When we login from 5, we are using kdm or gdm instead. The former have a footprint that can range between a few kb to a couple of MBs. The later have a ram footprint of at least a couple or three dozen MBs probably. There are other things to consider though, when you login in 3 you are spawing an extra bash session that will remain there, unless you do something like startx&exit which will fork and close the shell.

On a single user machine, if you ask me, it's a nonsense to have something like kdm or gdm just to look at it for a couple of seconds while you login. But I've never been an eyecandy lover myself and that's just my opinion of course.
 
Old 03-05-2009, 10:15 PM   #9
davidhk
Member
 
Registered: Jun 2005
Posts: 38

Original Poster
Rep: Reputation: 15
Thx fr your explanation. I had got the correct concept.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
startx or init 4 in Slackware errorsunknownp Linux - Newbie 18 02-20-2009 06:48 AM
kernal panic no init found try passing init option to kernel m2azer Linux - General 3 11-08-2007 02:51 PM
problems with startx and init 6 einstien Slackware - Installation 1 11-30-2004 10:25 AM
error "Kernel panic: No init found. Try passing init= option Anauj0101 Linux - Newbie 3 05-06-2003 11:18 PM
Does init 5 call startx? linuxlah Linux - General 4 03-05-2003 12:48 AM


All times are GMT -5. The time now is 12:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration