Byron Nevins wrote: > Hi all, > > I am trying to get SMF to manage a GlassFish V3 app server. I setup > SMF with 2 scripts that cause the server to start and stop respectively. > The "stop" command in GlassFish returns zero if and only if the server > was running and was successfully stopped. > The stop command returns one (error) if the domain was found to not be > running at all. > > > My Problem: > > 1. SMF starts up GlassFish > 2. I stop GlassFish externally (i.e. without the help of SMF) with a > kill or a normal stop-domain comand. > 3. SMF notices that the server went down and calls the stop command > 4. SMF gets a one back from the stop command and gives up. > 5. SMF never tries to start the server > > ===================== > > Is there some way I can configure SMF so that it ignores the return > value from the stop command?
Your stop method is flawed. It should return 0 if the service isn't running. From svc.startd: stop Stop the service. In some cases, the stop method can be invoked when some or all of the service has already been stopped. Only return an error if the service is not entirely stopped on method return. Returning a non-zero value when the service has been shut down through some external mechanism means that things like service restart on failure won't work. If step 2 wasn't just part of a testing procedure -- i.e. if your users will be using a separate command to stop GlassFish externally -- I recommend changing that interface to internally disable the SMF service. Otherwise you'll end up with two parts of the system with different notions of what should be running. Dave