1 2 Previous Next 21 Replies Latest reply on Oct 14, 2002 7:33 PM by lordy

    Avoid shutdown with CTRL-C?

    sebaseba

      Hi all,

      we are running JBoss 2.4.4 on Solaris 2.8 quite happily but there is one minor (?) issue that has caused a lot of headscratching:

      Whenever CTRL-C is pressed on the console from which JBoss was started, the shutdown sequence is invoked. This is even the case when starting JBoss as a background process, then e.g. doing a tail -f for the server log in the same console, and exiting with CTRL-C.

      I know that this behaviour is intentional, but is there a way to switch it off as it is a pain in the a** in our case?

      Any suggestions much appreciated.
      /Sebastian

        • 1. Re: Avoid shutdown with CTRL-C?
          chgrimm

          did you try to start jboss with nohup ?

          we have been running jboss-2.4.6 / 2.4.8 on solaris 5.8
          and there was never such a behaviour.

          • 2. Re: Avoid shutdown with CTRL-C?
            sebaseba

            Yes, we are using nohup.
            This did fix another issue we had earlier (JBoss was shutting down when exiting the telnet session from which it was started), but not this one.

            Which shell are you using? We are only getting the problem with the sh shell, no the csh or zsh shell. Unfortunately, we have to stick with sh :-(

            Any other thoughts?

            Thanks,
            Sebastian

            • 3. Re: Avoid shutdown with CTRL-C?
              sebaseba

              Yes, we are using nohup.
              This did fix another issue we had earlier (JBoss was shutting down when exiting the telnet session from which it was started), but not this one.

              Which shell are you using? We are only getting the problem with the sh shell, no the csh or zsh shell. Unfortunately, we have to stick with sh :-(

              Any other thoughts?

              Thanks,
              Sebastian

              • 4. Re: Avoid shutdown with CTRL-C?
                sebaseba

                Yes, we are using nohup.
                This did fix another issue we had earlier (JBoss was shutting down when exiting the telnet session from which it was started), but not this one.

                Which shell are you using? We are only getting the problem with the sh shell, no the csh or zsh shell. Unfortunately, we have to stick with sh :-(

                Any other thoughts?

                Thanks,
                Sebastian

                • 5. Re: Avoid shutdown with CTRL-C?
                  sebaseba

                  Yes, we are using nohup.
                  This did fix another issue we had earlier (JBoss was shutting down when exiting the telnet session from which it was started), but not this one.

                  Which shell are you using? We are only getting the problem with the sh shell, no the csh or zsh shell. Unfortunately, we have to stick with sh.

                  Any other thoughts?

                  Thanks,
                  Sebastian

                  • 6. Re: Avoid shutdown with CTRL-C?
                    sebaseba

                    Yes, we are using nohup.
                    This did fix another issue we had earlier (JBoss was shutting down when exiting the telnet session from which it was started), but not this one.

                    Which shell are you using? We are only getting the problem with the sh shell, no the csh or zsh shell. Unfortunately, we have to stick with sh.

                    Any other thoughts?

                    Thanks,
                    Sebastian

                    • 7. Re: Avoid shutdown with CTRL-C?
                      sebaseba

                      Feeling a bit stupid for posting the same thing five times ... my posts only showed up after a couple of hours, but I thought my browser had some stupid caching issue :-(

                      /Sebastian

                      • 8. Re: Avoid shutdown with CTRL-C?
                        sixpack

                        Strange behaviour, but I also had a similar problem on Solaris using a different appserver some years ago. If all else fails you can use "screen". This tool should be available by default on most Linux Systems. For Solaris there is a precompiled package available on http://www.sunfreeware.com/ see the man page for usage instructions. It's quite simple but very helpful.

                        • 9. Re: Avoid shutdown with CTRL-C?

                          use this in the last line in run.sh java $HOTSPOT $JAXP -classpath $JBOSS_CLASSPATH org.jboss.Main $@> 2>&1 < /dev/null &

                          • 10. Re: Avoid shutdown with CTRL-C?
                            sebaseba

                            Thanks for the suggestion - does not seem to make a difference though :-(

                            /Sebastian

                            • 11. Re: Avoid shutdown with CTRL-C?
                              sebaseba

                              The screen utility looks useful but is no good for us since customers expect a standard Solaris interface (we bundle JBoss with a product).

                              Any other ideas (apart from hacking the JBoss source)?

                              /Sebastian

                              • 12. Re: Avoid shutdown with CTRL-C?

                                hack the source :)

                                grep addShutdownHook and try using a null runnable there as opposed to the shutdown sequence and see if that helps?

                                • 13. Re: Avoid shutdown with CTRL-C?

                                  actually that probably won't help if your VM is still trapping that signal... now you just end up doing an unclean shutdown... :)

                                  • 14. Re: Avoid shutdown with CTRL-C?
                                    chrigri

                                    Try using the flagg "-Xrs" when starting the java VM.
                                    On Windows this will tell the VM to ignore ctrl-c from the console.

                                    This works nice when we run jboss as a service under win2k.

                                    --
                                    Christer

                                    1 2 Previous Next