|
From: Leif M. <le...@ta...> - 2006-09-15 06:50:40
|
Daniel, Yazbek, Daniel (Daniel) wrote: > I have downloaded and built wrapper v3.2.2-a from CVS. > > >From the testing I have done, the SIGHUP signal does get to the JVM, and > can be caught by the controlEvent in a class that implements > WrapperListener... Great! This works exactly as we anticipated. > Ok thanks for trying it out. > In the v3.2.2-a implementation, when a SIGHUP is received in wrapper, > does wrapper reload its config file? > The wrapper only reloads its config file if the wrapper.restart.reload_configuration property is TRUE when the JVM is restarted. For this reason, it will only be reloaded if you have wrapper.signal.mode.hup=RESTART. That will not work for you however as you do not want to restart your JVM. > When is the anticipated release date of v3.2.2? > I don't have a date right now. Still in development mode. Cheers, Leif > -----Original Message----- > From: wra...@li... > [mailto:wra...@li...] On Behalf Of Yazbek, > Daniel (Daniel) > Sent: Friday, 15 September 2006 15:15 > To: wra...@li... > Subject: Re: [Wrapper-user] Support SIGHUP Handling > > Leif, > > Thank you for your suggestion, I added the kill(jvmPid, sig_num) > statement in my sigActionHangup function and it worked! > > To put things into context, we would like to use SIG_HUP to reload the > config file used in the java application that is wrapped up within > wrapper. We do not want to terminate and start the java application, nor > do we want to terminate and start the wrapper application (although, we > don't mind if wrapper re-reads its config... this will never change for > us). It is important that the JVM is not interrupted. > > I would be happy to investigate v3.2.2 to see if it meets our needs > mentioned above. I will let you know how I go. > > > Further, in wrapper_unix.c I noticed you have the following two > functions: > > void sigActionTermination(int sigNum, siginfo_t *sigInfo, void *na) > void handleTermination(int sig_num) > > These two methods seem to be near identical in functionality, and for my > implementation of SIG_HUP, I have followed this convention. I have the > following two functions: > > void sigActionHangup( int sigNum, siginfo_t *sigInfo, void *na) > void handleHangup(int sig_num) > > With some debug logging, I have noticed that when I send a SIG_HUP to > wrapper, it is caught in the sigActionHangup method (i.e. not the > handleHangup method)... My question to you is, why are there two handle > methods defined for each signal type? What is the difference? And when > are each used? > > Thanks. > > -Daniel. > > > -----Original Message----- > From: wra...@li... > [mailto:wra...@li...] On Behalf Of Leif > Mortenson > Sent: Thursday, 14 September 2006 14:41 > To: wra...@li... > Subject: Re: [Wrapper-user] Support SIGHUP Handling > > Daniel, > The problem in your code is that you are trapping the HUP signal in the > Wrapper > process. That is part of the problem, but that signal is not yet being > sent on to the > Java process. If you send the Signal to the JVM process it would work. > > To fix these, you will need the following in your handleHangup function: > kill(jvmPid, sig_num) > > That said though, I have gotten this implemented for the 3.2.2 release. > It is all checked > in to CVS. If you could try it out it would be a big help. > > I have also added a new property, wrapper.signal.mode.hup, which takes > the values > IGNORE, SHUTDOWN, RESTART, or FORWARD. FORWARD is the default, > which sends the signal on to the JVM process. > > The RESTART mode can be used with the > wrapper.restart.reload_configuration > <http://wrapper.tanukisoftware.org/doc/english/prop-restart-reload-confi > guration.html> > property to cause the Wrapper to reload its wrapper.conf and restart the > > JVM when > it gets a HUP signal. As I understand it, that is a common use of this > signal. > > Are there any other signals which should be handled as well? > > Cheers, > Leif > > Yazbek, Daniel (Daniel) wrote: > >> Hi all, >> >> We are attempting to modify wrapper so that a SIGHUP can be handled by >> > > >> java code, I am after some help/suggestions. >> >> Here is what I've done so far: >> >> Modified WrapperManager.java with: >> >> *public* *static* *final* *int* WRAPPER_CTRL_SIGHUP_EVENT = 205; >> >> Recompiled the code, javah added this definition into >> org_tanukisoftware_wrapper_WrapperManager.h >> >> Modified wrapper_unix.c with: >> >> - added case in getSignalName(int signo) >> >> - written a handleHangup(int sig_num) function, with deceleration: >> >> *void* handleHangup(*int* sig_num) { >> >> /* Ignore any other signals while in this handler. */ >> >> signal(SIGHUP, SIG_IGN); >> >> handleCommon("HUP"); >> >> signal(SIGHUP, handleHangup); >> >> } >> >> - Modified wrapperInitialize() to support SIGHUP >> >> Modified wrapperjni_unix.c with: >> >> - added a handleHandup(int sig_num) function: >> >> *void* handleHangup(*int* sig_num) { >> >> signal(SIGHUP, handleHangup); >> >> > WrapperJNIHandleSignal(org_tanukisoftware_wrapper_WrapperManager_WRAPPER > _CTRL_SIGHUP_EVENT); > >> } >> >> - Set the above handler for a SIGHUP in the init function >> >> So, I guess I am missing something. I cannot get the SIGHUP in the >> java application from the controlEvent(int arg0) method of my class >> that implements WrapperListener. >> >> However, when I send a sighup, I get "HUP Trapped" in the log file, >> which is being generated by >> >> handleCommon(const char* sigName) >> >> I am not familiar with the architecture and a newbie to wrapper... >> >> Does anyone have any suggestions on where I should be heading towards >> from here? >> >> Thanks. >> >> -Dan. >> >> > > > ------------------------------------------------------------------------ > - > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > ------------------------------------------------------------------------ > - > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > |