Philipp Taprogge
11/5/2006 1:30:00 AM
Hi all!
I am kind of new to ruby so forgive if this is really stupid...
I am experimenting with trapping signals on linux.
It seems like a ruby script can only handle one signal at a time.
While in the trap block, all further occurences of that same signal
are lost.
What I want to do is react differently if a, say, SIGUSR1 comes in
while the script is already in that signal's trap block.
Is that at all possible?
A bit of background:
A have a script that parses some data and displays it on an external
lcd panel. The panel's only button can bind a command. I have bound
"kill -SIGUSR1 (pidof myscript.rb)" to it.
Now I want to implement some kind of saveguard where the first press
displays a warning ("are you sure...?") and the second while still
in the trap actually performs the function.
Thanks in advance and best regards,
Phil