Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: Guido on November 27, 2002, 10:05:43 PM

Title: Shut Down per keyboard
Post by: Guido on November 27, 2002, 10:05:43 PM
Hi!

I want my SME 5.5 server to be shut down per keyboard. (CTRL-ALT-DEL).
At the moment, the server makes a simple reboot.
What steps need to be taken ?

THX in advance !!!
Title: Re: Shut Down per keyboard
Post by: Harris on November 28, 2002, 12:12:37 AM
Try typing "reboot -h now" (as root)
Title: Re: Shut Down per keyboard
Post by: Ray on November 28, 2002, 12:15:35 AM
Thx Harris,

but i don't have a monitor installed and also don't want to ssh onto the server.
Just the old way with the keyboard.
IP-COP does a shut-down when pressing CTRL-ALT-DEL.
Title: Re: Shut Down per keyboard
Post by: Harris on November 28, 2002, 12:18:07 AM
Hope you can type blind :)

root -> enter -> root-password -> shutdown -h now
Title: Re: Shut Down per keyboard
Post by: Harris on November 28, 2002, 12:18:55 AM
Forgot some enters :)

root -> enter -> root-password -> enter -> shutdown -h now -> enter
Title: Re: Shut Down per keyboard
Post by: Ray on November 28, 2002, 12:21:10 AM
okay. that is also a way.   :-)))
Title: Re: Shut Down per keyboard
Post by: guestHH on November 28, 2002, 12:35:45 AM
Ctrl-Alt_Del will do, if you didn't disable it.
Title: Re: Shut Down per keyboard
Post by: Ray on November 28, 2002, 12:37:22 AM
the computer makes a reboot and no shut down. thats the prob.
Title: Re: Shut Down per keyboard
Post by: Rich Lafferty on November 28, 2002, 01:21:37 AM
Well, you can shutdown with "shutdown -h now"!

(Just kidding!)

Make a custom template for /etc/inittab:

mkdir -p /etc/e-smith/templates-custom/etc/inittab
cd /etc/e-smith/templates-custom/etc/inittab

Start with the existing init ctrlaltdel template:

cp /etc/e-smith.templates/etc/inittab/30ctrlaltdel .

Now edit /etc/e-smith/templates-custom/etc/inittab/30ctrlaltdel in
your favorite text editor, changing "shutdown -t3 -r now" to
"shutdown -t3 -h now".

Then expand the template:

/sbin/e-smith/expand-template /etc/inittab

And tell init to reread it:

telinit q

Now ctrl-alt-del should shut the machine down.

Cheers,

--Rich
Title: Re: Shut Down per keyboard
Post by: Ray on November 28, 2002, 01:26:21 AM
Yeahhhhhoooooo.
Many THX    Rich    :-)))
Title: Re: Shut Down per keyboard
Post by: Jáder Marasca on November 28, 2002, 03:33:20 AM
There is a way... edit a .XXX file (I can remember the file right now!)  maybe if you look at root of IPCOP (if you can!) it´s a hidden file  something like .bash or whatever...

There is a line saying what CTRL ALT DEL do... just change it to -h instead of -r
Title: Re: Shut Down per keyboard
Post by: Guido on November 30, 2002, 12:58:43 AM
THX also Jáder for the hint. Will see if i can find the file....
Title: Re: Shut Down per keyboard
Post by: Guido on November 30, 2002, 01:08:04 AM
So,

can't find the file. In the .bashrc file is no entry.  mmhhhhh
Title: Re: Shut Down per keyboard
Post by: Jáder Marasca on November 30, 2002, 03:01:14 AM
I´ll do a google search and return to you ASAP!
Title: Re: Shut Down per keyboard
Post by: Jáder Marasca on November 30, 2002, 03:07:34 AM
A quick search returned this... I have no access to a SME or a linux server right now... so just try yourself and return!

http://www.uwsg.iu.edu/hypermail/linux/kernel/9802.2/0407.html
Title: Re: Shut Down per keyboard = FOUND!
Post by: Jáder Marasca on November 30, 2002, 03:12:10 AM
I found it! Finally... almost 5 minute search!
"
Rebooting the system
If possible you should make rebooting the system more difficult, by default almost all Linux distributions have ctrl-alt-del enabled so that it reboots the machines. However, unlike Windows, this is not necessary. In Linux you can easily control the behavior of ctrl-alt-del, simply by editing the /etc/inittab file:

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

"

from : http://www.seifried.org/lasg/system/

I presume this will work!!
Title: Re: Shut Down per keyboard = FOUND!
Post by: Guido on November 30, 2002, 05:28:38 PM
Many THX Jáder.  
( 5 Minutes search ?. Damn   :-))  )


Guido
Title: Re: Shut Down per keyboard ::RPM
Post by: stephen noble on December 04, 2002, 05:30:43 PM
>Now ctrl-alt-del should shut the machine down.
>Cheers,
>--Rich

thanks rich, this saves me 20 seconds every other night :-)
and in case your instructions are lost i made it an rpm

http://www.dungog.net/sme/files/

dungog-controlaltdel-shutdown-0.1-1.noarch.rpm

regards
stephen noble
Title: ctraltdel Shutdown
Post by: flipp on April 03, 2004, 05:48:33 AM
I have made the suggested change to the /etc/inittab file and modified the shutdown command to not include -r switch. I assume that this was the only change required.

Is there anything else that needs to be changed or have I insufficiently changed the shutdown comand?
Title: Shut Down per keyboard
Post by: bobk on April 04, 2004, 04:25:28 AM
In SME 6.0 the template numbers have changed. So using Richard Lafferty's HowTo (on the first page of this thread) will not work without changing the template fragment number as shown below. Installing Steven Noble's RPM results in /etc/inittab[48]: duplicate ID field "ca"

On 6.0 you need to modify Richard Lafferty's HowTo  as follows:

Make a custom template for /etc/inittab:

mkdir -p /etc/e-smith/templates-custom/etc/inittab
cd /etc/e-smith/templates-custom/etc/inittab

Start with the existing init ctrlaltdel template:

cp /etc/e-smith.templates/etc/inittab/15ctrlaltdel .

Now edit /etc/e-smith/templates-custom/etc/inittab/15ctrlaltdel in
your favorite text editor, changing "shutdown -t3 -r now" to
"shutdown -t3 -h now".

Then expand the template:

/sbin/e-smith/expand-template /etc/inittab

And tell init to reread it:

telinit q

Now ctrl-alt-del should shut the machine down.