Hi!
I was pondering over this for long. Is it possible to give a halt/reboot option at console when the system is started at runlevel 3 ? This is given by default if you login at runlevel 5.
One method seems to be : 1. Make a user named halt ( there already seems to be in /etc/passwd ) 2. Disable its password 3. edit its .bashrc so that halt command is issued immediately on login 4. similar steps for reboot
Can someone suggest some other more secure/logical solution to this ? Is the halt/reboot functionality in runlevel 5 achieved with same method as discussed above ?
well every runlevel has its own directory so i think u can modify the .bashrc of runlevel3
the dir i think exists under /etc/rc.d
hope u find this useful ----- Original Message ----- From: "Nikhil Joshi" nikhil_joshi@gmx.net To: linuxers@mm.ilug-bom.org.in Sent: Monday, November 10, 2003 10:14 PM Subject: [ILUG-BOM]Halt option at start
Next LUG meet: 9 Nov 2003 around 4 pm - VJTI
Hi!
I was pondering over this for long. Is it possible to give a halt/reboot option at console when the system is started at runlevel 3 ? This is given by default if you login at runlevel 5.
One method seems to be :
- Make a user named halt ( there already seems to be in /etc/passwd )
- Disable its password
- edit its .bashrc so that halt command is issued immediately on login
- similar steps for reboot
Can someone suggest some other more secure/logical solution to this ? Is the halt/reboot functionality in runlevel 5 achieved with same method as discussed above ?
-- Nikhil Joshi http://nikhil.ne1.net
» > I was pondering over this for long. Is it possible to give a » > halt/reboot option at console when the system is started at runlevel 3 ?
I often ran into this situtation of accidentally starting into Linux. I simply press Ctrl-Alt-Del as it causes a gracefull restart.
Thanks and Regards, Kiran Ghag Web Page: http://kiran7.freeservers.com
_____
A person is just about as big as the things that make them angry.
On Tue, 11 Nov 2003, K i r @ n G h a g wrote:
I often ran into this situtation of accidentally starting into Linux. I simply press Ctrl-Alt-Del as it causes a gracefull restart.
sure, if you have enabled the 3 finger salute in /etc/inittab
Can someone suggest some other more secure/logical solution to this ? Is the halt/reboot functionality in runlevel 5 achieved with same method as discussed above ?
Can you please in more detail what do you want to achieve? Examples would be great.
On Tue, 11 Nov 2003, Vinayakam Murugan wrote:
Is the halt/reboot functionality in runlevel 5 achieved with same method as discussed above ?
Can you please in more detail what do you want to achieve? Examples would be great.
I want an option at runlevel 3 ( Console-only login .. no GUI login ) to choose halt or reboot the PC. This is useful in case someone accidentally boots into Linux instead of some other OS.
This option is provided in case you login through graphical interface ( runlevel 5 )
I hope I've elucidated.
On Tue, Nov 11, 2003 at 02:09:26PM +0530, Nikhil Joshi wrote:
I want an option at runlevel 3 ( Console-only login .. no GUI login ) to choose halt or reboot the PC. This is useful in case someone accidentally boots into Linux instead of some other OS.
Your original idea of putting a login whose job is to shutdown seems interesting ... but what happens if someone telnets to that machine with the same login? You'll need to make sure that this particular login can _only_ work from getty running on a local terminal, no other service should be allowed.
You don't need to edit .bashrc ... you should be able to invoke "shutdown" as the login shell from /etc/passwd itself! DISCLAIMER: I havn't tried this myself, don't know if it can work.
This will be useful for shared PCs that need to be shutdown without knowing the root password!
Sameer.
On Tue, 11 Nov 2003, Nikhil Joshi spake thusly:
Is the halt/reboot functionality in runlevel 5 achieved with same method as discussed above ?
Can you please in more detail what do you want to achieve? Examples would be great.
I want an option at runlevel 3 ( Console-only login .. no GUI login ) to choose halt or reboot the PC. This is useful in case someone accidentally boots into Linux instead of some other OS.
What about running a script in rc3.d ? S99[myreboot|myhalt] or something?
I hope I've elucidated.
well can ya elucidate a bit more about elucidating ?
;-)
Nikhil Joshi wrote:
I want an option at runlevel 3 ( Console-only login .. no GUI login ) to choose halt or reboot the PC. This is useful in case someone accidentally boots into Linux instead of some other OS.
In case some one accidentally boots into Linux then he/she can directly press Ctrl+Alt+Del to reboot, without having to login at all.
HTH, Rajen.
On Wed, Nov 12, 2003 at 11:00:38AM +0530, Rajen M. Parekh wrote:
I want an option at runlevel 3 ( Console-only login .. no GUI login ) to choose halt or reboot the PC. This is useful in case someone accidentally boots into Linux instead of some other OS.
In case some one accidentally boots into Linux then he/she can directly press Ctrl+Alt+Del to reboot, without having to login at all.
The trouble with the three-finger salute is that it remains active even after the user has logged in. If you want to disable that, for whatever reason, you need some other way to allow a halt/reboot when you enter runlevel 3.
Sameer.