LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-10-2006, 02:20 PM   #1
rip
Member
 
Registered: Apr 2003
Location: Ohio
Distribution: PCLinuxOS
Posts: 97

Rep: Reputation: 15
question on changing runlevels


I assist with a server running RHEL v4. It has runlevel 3 set as default in the inittab.

On occasion, I like to switch to runlevel 5 to run gui tools. I do this by running 'init 5' . When I am done, I run 'init 3'. I see processes being started and/or killed.

My question is this: does the runlevel change via init cause any interruption to the application this server is running? It seems that there is no interruption to any service.
 
Old 08-10-2006, 05:32 PM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
For a very brief period of time (way less then .5 seconds) yes

You should know that typing 'startx' minus the single quotemarks is a better way to do the samething as 'init 5' / 'init 3' bit.
 
Old 08-14-2006, 10:30 AM   #3
penguintutor
Member
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu, Mandriva, Redhat and Fedora
Posts: 118

Rep: Reputation: 15
It should not. It will only affect services that are scheduled to change status (ie. those that weren't started in the current runlevel, that should be in the new runlevel and vice versa).

What happens when you change runlevel is that init calls the /etc/rc.d/rc script* (with the new runlevel as the argument) which looks in the appropriate rc.d directories to determine which scripts have already been run for the current runlevel, and which scripts need to be started / stopped in the new runlevel. It then runs the appropriate start / stop scripts.

* This is the name of the script in RedHat / Fedora (different distribution may use different names).

Unlike in some unix operating systems only those in the new runlevel will be run. Some UNIX operating systems will also run scripts that are between (e.g. moving from 3 to 5 will first go to 4 and then 5). This is not the case for Linux.

If a service does not change status when you change runlevel then it won't be affected.
 
Old 08-14-2006, 02:59 PM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
I'd second Lenard's suggestion to use `startx` instead which is guaranteed to work in any distro.
 
  


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
changing runlevels stops X? CoonerTheRed Linux - Newbie 2 05-15-2005 10:45 AM
Question About Runlevels opsraja Fedora 6 11-24-2004 02:53 PM
RunLevels bcom Mandriva 3 05-31-2004 07:07 PM
Prevent services from restarting when changing runlevels fearofcarpet Red Hat 1 11-13-2003 02:22 PM
changing runlevels at boot time on GRUB denominator Linux - Newbie 3 11-04-2003 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:35 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