Signal already used by VM: SIGTERM

Help
sli
2013-04-29
2013-06-12
  • sli

    sli - 2013-04-29

    Hi,

    I am using the latest release 11.06 to wrap a java application.  It runs okay from the console, i.e., runcosole.bat.  But when I try to start the service, i.e, starService.bat, the application failed to start due to the following exception:

    Exception java.lang.IllegalArgumentException: Signal already used by VM: SIGTERM

    If I run the following copied from the service property from the command line, nothing happens:

    "D:\test\bin\work\test.exe" "-classpath" "D:\test\yajsw-stable-11.06\wrapper.jar" "-Xrs" "-Dwrapper.service=true" "-Dwrapper.working.dir=D:\ClassOne\MidTier_3_4_0_EM\bin" "-Dwrapper.config=D:\test\yajsw-stable-11.06\conf\wrapper.conf" "-Dwrapper.additional.1x=-Xrs" "-Djna_tmpdir=D:\TEMP" "org.rzo.yajsw.boot.WrapperServiceBooter"

    The application has a few shutdown hooker:

    // Process SIGTERM
    Signal.handle(new Signal("TERM"),handler_term);
    // Process SIGINT
    Signal.handle(new Signal("INT"),handler_int);

    Java: 16.0.17
    OS: Windows XP SP3

    Could the problem be related to the -Xrs? Any ideas?

    Thanks,

     
  • rzo

    rzo - 2013-05-02

    Hello,

    -Xrs and Signal handling do not work together. See java documentation for -Xrs.

    Is there a reason why you are using signal handler instead of shutdown hook ?
    The signal handling class is sun propriatary where as shutdown hooks are general.

    yajsw adds -Xrs, to avoid the application from shuting down when a user logs-off.

    • Ron
     
  • sli

    sli - 2013-05-03

    Ron,

    Thank you.  The same piece of code works fine with JSW.  Any work around?

    Thanks,

     
  • rzo

    rzo - 2013-05-04

    hello,

    the only way to solve this is to remove -Xrs from the command file:

    in WrappedJavaProcess.jvmOptions comment out

    result.add("-Xrs");

    to build the jar files:
    go to <yajsw>/build/gradle and execute gradlew.bat

    For the next release i will add a configuration property so users can control if -Xrs is added automatically to the command line.

    • Ron
     
  • sli

    sli - 2013-05-06

    Ron,

    Thank you.  I will try it out.

     
  • sli

    sli - 2013-05-06

    Hi Ron,

    I recompiled the class, and now it works, thank you!  Another observation is that YAJSW and our application are displaying same java command name in the task manager list if I specify the following:

    wrapper.java.command = D:\\0_ClassOne\\MidTier_3_4_test\\bin\\work\\Wrap01.exe

    In JSW, since it uses wrapper.exe instead of jar, I can rename it to any name I want.  Can I do the same in YAJSW?

     
  • rzo

    rzo - 2013-05-07

    hello,

    to use rename the jvm exe see the property:

    wrapper.java.customProcName

    note that java must be cleanly installed on the machine, eg not just copied. otherwise, the jvm will have issues finding the corresponding dll.

    • Ron
     
  • sli

    sli - 2013-05-07

    Hi Ron,

    It works like a charm! Thank you!  Initially I just gave a name to wrapper.java.customProcName property, e.g.:

    wrapper.java.customProcName=test

    and it did not work, and later I changed to the following:

    wrapper.java.customProcName=c://path_to_renamed_java//test.exe

    then it worked.

     
  • rzo

    rzo - 2013-05-09

    hello,

    for the next release a new property has been added:

    wrapper.ntservice.reduce_signals
    

    setting it to false will inhibit setting -Xrs.

    • Ron
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks