Re: What to do on ctrl-alt-del?

Matthias Urlichs (smurf@nova.noris.net)
15 Jul 1997 18:18:41 +0200


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