How to disable Ctrl-C during init (initial ramdisk / normal init)
Yoann Allain
yallain at avilinks.com
Tue May 23 08:08:24 UTC 2006
Bernhard Fischer a écrit :
>On Mon, May 22, 2006 at 06:26:39PM +0200, Yoann Allain wrote:
>
>
>>Hello,
>>
>>Although I found many subjects related to 'Ctrl-C doesn't work', I
>>didn't find one to explain how to ignore these signals during init with
>>Busybox.
>>I would like to avoid any Ctrl-C interrupt the different scripts used
>>during init of the system.
>>I tried using the "trap" command in my shells scripts but I can still
>>stop the system init either in my rcS script-shell or in in my linuxrc
>>embedded in the initial ramdisk.
>>
>>I didn't find any configuration option for this purpose so I think that
>>the only way to do it is to modify busybox. But perhaps it is simply
>>impossible to do because of others issues that I am not aware of...
>>
>>Does anyone have an idea about this problem?
>>
>>
>
>Works for me in ash..
>
>$ cat sleep.sh
>
>#echo "ignoring ctrl-c in this shell only"
>#trap ":" INT QUIT TSTP
># or
>echo "ignoring ctrl-c in this shell including children"
>trap '' INT QUIT TSTP
>i=30
>while test $i -gt 0;
>do
> sleep 1
> echo -n .
> i=$(($i - 1))
>done
>
>
>
>
Hi,
Thanks for your answer and yes, when I use this script, I can ignore ctrl-c.
But if you put these lines in /linuxrc, you can still avoid them to be
executed by permanently pressing ctrl-c when the system starts. And this
is my problem.
Do you have any idea?
TIA, Yoann
More information about the busybox
mailing list