Hello Edin,

Another way to do this is to make a simple module (ie. running in kernel space)
that would monitor a button.  When your button is pressed, it would execute
the following line:

kill_proc (1, SIGINT, 1);

That is the same function call made when you hit "ctrl-alt-del".  If
your inittab contains a line such as:

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

then, whenever your button is pressed, the kernel will do a complete shutdown,
including running "rc.6" script (or the scripts in rc6.d).  Just add a beep
or two to the end of the shutdown script if you have a speaker so you don't
have to see the shutdown messages.

On Sat, 10 Jul 1999, Edin Bektesevic wrote:

> Actually, I took a look at the source of apmd. Now I think I have a
> really easy solution. 
> 
> apmd calls sync() just after the button has
> been pressed. Instead of executing sync, I guess one could do
> whatever else (execute some script or something), buy simply changing
> the source.

Reply via email to