lkml.org 
[lkml]   [1997]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: What to do on ctrl-alt-del?
Date
Hubert Mantel <mantel@suse.de> writes:
> Several modern distributions do an install this way: Boot the system and
> load an initrd. linuxrc is started, loads modules and does/starts the
> installation. After the installation is completed, the new root device is
> written to /proc/sys/kernel/real-root-dev and linuxrc terminates. After
> that, the freshly installed system is started. This is the moment when
> init is started. Before that there is no process with pid 1. If the user
> presses ctrl-alt-del the system will reboot immediately and may trash your
> filesystems (for example when performing an update of the system).
>
Of _course_ there is a process with PID 1. It's just a simple shell script
(or whatever) though, not a full-blown init.

If you want to survive a control-alt-delete with such a shell, then trap
the signal you get when the user pushes control-alt-delete. (And do tell
the kernel to send you a signal, of course.)

The shell does have a 'trap' builtin, after all...

--
Quack!
Quack!! Quack!!
--
Matthias Urlichs \ noris network GmbH / Xlink-POP Nürnberg
Schleiermacherstraße 12 \ Linux+Internet / EMail: urlichs@noris.de
90491 Nürnberg (Germany) \ Consulting+Programming+Networking+etc'ing
PGP: 1024/4F578875 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE
Click <A HREF="http://info.noris.de/~smurf/finger">here</A>. 42

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.072 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site