# Challenged with signal

**URL:** <https://www.ruby-forum.com/t/challenged-with-signal/124162>\
**Category:** Ruby\
**Created:** [December 25, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/challenged-with-signal/124162 "2007-12-25T22:25:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [December 25, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/challenged-with-signal/124162/1 "2007-12-25T22:25:34Z")

</div>

Hello  
I am playing around with the jabber bot fron the link  
[http://nearlyfree.org/fun-jabber-bots](http://nearlyfree.org/fun-jabber-bots).

I get a error at the following code next to trap. not sure why it is  
happening. i thought you could send any string to trap a signal. can  
someone help.

E:\Tools\CODE\>ruby bot1.rb  
bot1.rb:23:in `trap’: unsupported signal SIGUSR1 (ArgumentError)  
from bot1.rb:23

# Wait for the USR1 signal and read a message from ~/.jbot/message

trap(“USR1”) {  
begin  
bot.deliver(bot.master,File.new(File.join(home, “message”)).read)  
rescue Exception =\> e  
puts e  
end

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [December 26, 2007, 12:05am UTC](https://www.ruby-forum.com/t/challenged-with-signal/124162/2 "2007-12-26T00:05:40Z")

</div>

On Dec 25, 3:23 pm, Junkone [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello  
> I am playing around with the jabber bot fron the linkhttp://nearlyfree.org/fun-jabber-bots.
> 
> I get a error at the following code next to trap. not sure why it is  
> happening. i thought you could send any string to trap a signal. can  
> someone help.

The documentation for Kernel#trap wants to help…but you have to let  
it. 😉

> end  
> Regard,  
> Jordan

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [December 26, 2007, 12:20am UTC](https://www.ruby-forum.com/t/challenged-with-signal/124162/3 "2007-12-26T00:20:53Z")

</div>

On Dec 25, 6:02 pm, MonkeeSage [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> it. 😉
> 
> > ```
> > puts e
> > 
> > ```
> > 
> > end
> 
> Regard,  
> Jordan

Jordon. i understand u wnat me to read the docs which i did over and  
over again before posting the question. i am still not getting the  
answer to my prob. as per the ruby docs. \<\< The first parameter is a  
signal name (a string such as `SIGALRM'', `SIGUSR1’‘, and so on) or  
a signal number. The characters ``SIG’’ may be omitted from the signal  
name\>\>  
so what am i missing. appreciate help here.

seede

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [December 26, 2007, 12:35am UTC](https://www.ruby-forum.com/t/challenged-with-signal/124162/4 "2007-12-26T00:35:30Z")

</div>

On Dec 25, 6:18 pm, Luis L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > bot1.rb:23:in `trap’: unsupported signal SIGUSR1 (ArgumentError)
> 
> Luis

thanks for letting me know. i guess i cannot trust the chm file too  
much.  
seede

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [December 26, 2007, 12:23am UTC](https://www.ruby-forum.com/t/challenged-with-signal/124162/5 "2007-12-26T00:23:13Z")

</div>

On 25 dic, 18:23, Junkone [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

The error message wasn’t too descriptive?

unsupported signal SIGUSR1, there you go.  
USR1, USR2 and TERM are unsupported signal on Windows.

Only INT (INTERRUPT) is working.

HTH,

Luis

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [December 26, 2007, 4:13am UTC](https://www.ruby-forum.com/t/challenged-with-signal/124162/6 "2007-12-26T04:13:01Z")

</div>

On Dec 25, 2007, at 6:34 PM, Junkone wrote:

> thanks for letting me know. i guess i cannot trust the chm file too  
> much.

The documentation for Kernel#trap doesn’t mention that not  
all signals are supported on all systems, but the documentation  
for the Signal class is a bit better:

> The list of available signal names and their interpretation is  
> system dependent. Signal delivery semantics may also vary between  
> systems; in particular signal delivery may not always be reliable.

It still doesn’t give you a recipe for determining what signals  
are available in your environment but at least it mentions that  
this is system dependent.

Gary W.
