LinuxQuestions.org
Help answer threads with 0 replies.
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 01-16-2007, 09:34 PM   #1
windycity_linux
Member
 
Registered: Mar 2006
Distribution: rhel 5
Posts: 74

Rep: Reputation: 15
Exclamation changing to runlevel 1


I want to change to run level 1 (single user mode) for system maintenance. I know i can do that with init 1 or telinit 1. But how do i warn the connected user about the upcoming event? (I mean something like the messages send by shutdown command when shuting down)

thanks for your help
 
Old 01-16-2007, 09:49 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Now that you mention shutdown... just one idea:

Code:
# shutdown -r +5 'Save your work now. System going down for maintenance.'
Then just boot to single-user mode using grub (or lilo?) after the five minutes / reboot occurs.

Last edited by anomie; 01-16-2007 at 09:55 PM.
 
Old 01-16-2007, 09:55 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
You can use the wall command to write a message to all logged in users. Have a look at man wall for more info
 
Old 01-16-2007, 09:59 PM   #4
windycity_linux
Member
 
Registered: Mar 2006
Distribution: rhel 5
Posts: 74

Original Poster
Rep: Reputation: 15
or may be using
#shutdown -k +5 "blah blah" and the use
#init 1

I was wondering any single command to do the both and switching runlevel without rebooting the system. But may be it can not be done

thanx
 
Old 01-16-2007, 10:11 PM   #5
windycity_linux
Member
 
Registered: Mar 2006
Distribution: rhel 5
Posts: 74

Original Poster
Rep: Reputation: 15
GOT IT (it was simple - but something new i learned today)
u can use shutdown command to switch to runlevel 1 (single user mode) & warn connected user as well

#shutdown +5 "system going down for maintenance in 5 minutes"

using shutdown without any options (ie -h, -r) will change the runlevel to 1.
 
Old 01-16-2007, 10:14 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
You're right - that's a good way to do it. I overlooked it in the shutdown manpage on my GNU/Linux system.
 
  


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
Changing ipv4's ports range in runlevel tuanito Linux - Networking 2 08-07-2006 07:45 AM
Soun Mixer absent in Runlevel 3 but present in Runlevel 5 debloxie SUSE / openSUSE 1 01-18-2006 09:15 AM
Changing runlevel in Fedora Cake Linux - Newbie 1 11-11-2004 07:24 PM
problem in changing runlevel in linux schandak Red Hat 1 09-24-2004 05:25 PM
problem changing runlevel Smokey Slackware 3 08-17-2004 10:05 PM


All times are GMT -5. The time now is 08:20 PM.

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