LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-10-2006, 06:30 AM   #1
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Rep: Reputation: 31
Reconfigure CTRL-ALT-DELETE on Edgy Eft


Hi

I'm currently setting up a Samba server using the Ubuntu-Server version of Edgy Eft. The server is supposed to work without monitor as occasional backup, so it's shut down most of the time. I need an clean and easy way to shut down the machine when the work is down. On the previous Debian system, hacking around in an configuration file allowed to reallocate a command to CTRL-ALT-DELETE, so instead of rebooting, the system was shutting down and halted. How do I do this in Efty? Now it is rebooting, which is not what I need. The configuration file which controlled this (/etc/initsomething) isn't present in Efty. The key combination must work on the login screen too.

Thanks for your help

Last edited by hansalfredche; 12-10-2006 at 06:33 AM.
 
Old 12-10-2006, 01:04 PM   #2
zmanea
Member
 
Registered: Sep 2003
Location: Colorado
Posts: 85

Rep: Reputation: 15
It is in /etc/inittab. Look for the following line:

ca::ctrlaltdel:/sbin/shutdown -t3 -r now
 
Old 12-10-2006, 01:10 PM   #3
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Well that's the whole point: there is no file /etc/inittab ... otherwise I would have found it.

Could it have something to do with Efty not using init any more?
 
Old 12-12-2006, 08:43 AM   #4
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Nobody has any idea how to change that?
 
Old 12-15-2006, 08:01 AM   #5
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Is it really impossible?
 
Old 12-18-2006, 05:11 AM   #6
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Up

Last attempt.
 
Old 12-18-2006, 09:32 PM   #7
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
Here's the method I used to remap <Crtl><Alt><Del> in a Gnome environment. It would seem that shortcuts are a GUI level function. KDE has a different method tied to file associations. You may have to run at least a low level GUI like fluxbox.

Keyboard shortcuts with custom commands at least are easy to do, and no extra apps are required:

1. press alt-F2 and run gconf-editor
2. browse to apps/metacity/keybinding_commands
3. set the value of 'command_1' to the command you want to run
4. go to apps/metacity/global_keybindings
5. set the value of 'run_command_1' to the key combo you want to use
 
Old 12-20-2006, 12:04 PM   #8
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Thanks. However, I have no GUI installed, so it won't work

It's just strange that the /etc/inittab isn' present. Then I could just do what zmanea proposed. It's what I had done on the previous system.
 
Old 12-20-2006, 02:50 PM   #9
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
I checked my Ubuntu Gnome install and there is an /etc/inittab. I've pasted a copy for your information. I see it has shutdown set for <Ctrl><Alt><Del> but that key binding did nothing. Perhaps GUI key binding replace those in inittab. You might try adding an inittab to see what happens.

# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf:owerwait:/etc/init.d/powerfail start
pn:owerfailnow:/etc/init.d/powerfail now
po:owerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
# <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
 
Old 12-21-2006, 01:36 AM   #10
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Thanks. I will try to copy it. Maybe it works.
 
Old 12-26-2006, 07:45 AM   #11
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Well, I've made some adjustements (corrected where smileys were, removed 12345 and removed the -r option) and copyied it to /etc, but it doesn't work. Ubuntu seems to ignore the file.
 
Old 12-26-2006, 06:57 PM   #12
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
Smileys are nice when you want them but they sure stink in the middle of a CLI. Perhaps if there were some rules about smiley context the situation would be better. I've looked but haven't found a way to turn them off -- probably looking in the wrong place. I'm running out of suggestions. All my boxes have GUIs so I don't know where to go with this. Best of luck. Hopefully you'll be able to post a solution we can all learn from.
 
Old 01-04-2007, 12:43 AM   #13
knapjack
LQ Newbie
 
Registered: Jan 2007
Posts: 1

Rep: Reputation: 0
So, there's no /etc/inittab in Edgy, it's been replaced by Upstart.

Try editing /etc/event.d/control-alt-delete instead.

-Jack
 
Old 01-04-2007, 01:11 AM   #14
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
Quote:
Originally Posted by knapjack
So, there's no /etc/inittab in Edgy, it's been replaced by Upstart.

Try editing /etc/event.d/control-alt-delete instead.

-Jack
I found this file and is scripted for shutdown. Metacity and Gnome must override this when they are running. I configured key bindings for Ctrl-Alt-Del to execute System-Monitor and it works that way.
 
Old 01-04-2007, 10:37 AM   #15
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Original Poster
Rep: Reputation: 31
Thanks, that's exactly what I was suspecting. But I had no idea which file Upstart is using and I couldn't find the information. Now it works as expected.

The file is actually scripted to restart, as the command "shutdown -r now" does nothing but this. As you mentioned, one has simply to change that r to h, so it will halt (and leave the rest as is):

shutdown -h now [there is something here on the same line I don't remember, I left it as it is]

Last edited by hansalfredche; 01-04-2007 at 10:42 AM.
 
  


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
The Origin Of Ctrl-Alt-Delete adamb10 General 2 08-07-2005 02:07 PM
ctrl-alt-delete for linux? albean Linux - Newbie 5 12-01-2004 04:19 AM
Ctrl Alt Delete What? Brother Michael Linux - Newbie 2 12-09-2003 09:38 AM
Ctrl+Alt+Delete Agileuk Linux - Newbie 5 09-27-2003 06:13 PM
You may now exit and restart using ctrl-alt-delete ... I wish! pbhj Slackware 4 12-06-2002 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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