Bookmark Topic Watch Topic
  • New Topic

How to handle : Signal already used by VM: SIGUSR1  RSS feed

 
sumit anand kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Report post to moderator
I wish to do signal handling for some specific user signals in my Java Code. I was targeting to use SIGUSR1 & SIGUSR2
I understand there is an option in Solaris to tell JVM not to use SIGUSR1 & SIGUSR2. But what about RHEL5?
I use jdk6 on RHEL5.

I get :
Exception in thread "main" java.lang.IllegalArgumentException: Signal already used by VM: SIGUSR1
at sun.misc.Signal.handle(Signal.java:149)

If i start with -Xrs option

Exception in thread "main" java.lang.IllegalArgumentException: Signal already used by VM: SIGTERM
at sun.misc.Signal.handle(Signal.java:149)


Various signals I already use in my code are INT,TERM,ABRT,PIPE & HUP
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm not sure but the error message sounds like there's already a handler registered by the VM (Java Virtual Machine) for the signal you're interested in, and it doesn't let you handle another handler.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is already being discussed here: http://www.coderanch.com/t/573779/java/java/signal#2632275. I've posted a reply in that thread, locking this one.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!