Commit MetaInfo
Log Message
Prepare for 3.5.14 release.
Change Summary
Diff
| | @@ -1,5 +1,5 @@ | | 1 | 1 | ----------------------------------------------------------------------------- | | 2 | | -Java Service Wrapper Community Edition 3.5.14-a | | 2 | +Java Service Wrapper Community Edition 3.5.14 | | 3 | 3 | Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved. | | 4 | 4 | http://wrapper.tanukisoftware.com | | 5 | 5 | ----------------------------------------------------------------------------- |
| | @@ -1,5 +1,5 @@ | | 1 | 1 | ----------------------------------------------------------------------------- | | 2 | | -Java Service Wrapper Community Edition 3.5.14-a | | 2 | +Java Service Wrapper Community Edition 3.5.14 | | 3 | 3 | Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved. | | 4 | 4 | http://wrapper.tanukisoftware.com | | 5 | 5 | ----------------------------------------------------------------------------- |
| | @@ -1,5 +1,5 @@ | | 1 | 1 | ----------------------------------------------------------------------------- | | 2 | | -Java Service Wrapper Community Edition 3.5.14-a | | 2 | +Java Service Wrapper Community Edition 3.5.14 | | 3 | 3 | Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved. | | 4 | 4 | http://wrapper.tanukisoftware.com | | 5 | 5 | ----------------------------------------------------------------------------- |
| | @@ -2,6 +2,13 @@ | | 2 | 2 | -------------------------------------- | | 3 | 3 | | | 4 | 4 | 3.5.14 | | 5 | +* Fix a problem in the AppCommand.bat.in file where a parenthesis in the | | 6 | + file name of the Wrapper binary would have caused a | | 7 | + "PATH was unexpected at this time" error. | | 8 | +* (Standard, Professional) Fix a problem when using a localized version of | | 9 | + the Wrapper on Windows 64-bit platforms where the Wrapper would continue | | 10 | + to use the default system language even wrapper.lang was used to specify | | 11 | + a different language. Introduced in 3.5.12. | | 5 | 12 | * Fix a problem in the Windows AppCommand.bat.in command based batch file | | 6 | 13 | where the 'status' command was incorrectly being reported as 'query' in the | | 7 | 14 | usage output. The 'status' command had always worked correctly if used. |
| | @@ -17,6 +24,29 @@ | | 17 | 24 | read-only check of the pid file. | | 18 | 25 | * Fix a problem with the UNIX script where the 'remove' command was trying to | | 19 | 26 | stop a running application even when the application had not been installed. | | 27 | +* Fix a buffer overflow which could potentially cause a crash during the | | 28 | + installation of a Windows Service when wrapper.ntservice.account was | | 29 | + specified. This was introduced in 3.5.12. | | 30 | +* Fix a heap corruption which could occur on startup and potentially cause a | | 31 | + crash. Only Windows systems, which use the System Event logs, were affected. | | 32 | + Discovered from a code review, there had never been any reports of this | | 33 | + causing problems for users. This could happen if the configured wrapper.log | | 34 | + could not be written to as the Wrapper always tries to write to the Event | | 35 | + Log in such cases. Introduced in 3.5.12. | | 36 | +* Add a new version comparison between the UNIX shell script and Wrapper to | | 37 | + start showing a warning in case of a version mismatch. The check will only | | 38 | + work if the shell script and Wrapper are each of at least version 3.5.14. | | 39 | +* Added a new wrapper.pidfile.strict property which will tell the Wrapper not | | 40 | + to start if the pid file already existed. Defaults to false for backwards | | 41 | + compatibility. | | 42 | +* Make the Java side of the backend socket more resilient in case of a read | | 43 | + or write timeout. The backend socket does not have a timeout set by default | | 44 | + so this should not have been an issue. A couple users reported problems on | | 45 | + specific systems however which led to this fix. | | 46 | +* To aid in the testing of the backend socket timeout, a new | | 47 | + wrapper.backend.so_timeout system property was added to make it possible to | | 48 | + configure the backend socket to use a timeout. See the Javadocs of the | | 49 | + WrapperManager class for details. | | 20 | 50 | | | 21 | 51 | 3.5.13 | | 22 | 52 | * Fix a typo in the script where the environment variable 'TR_BIN' should |
| | @@ -48,6 +48,7 @@ | | 48 | 48 | import java.net.ServerSocket; | | 49 | 49 | import java.net.Socket; | | 50 | 50 | import java.net.SocketException; | | 51 | +import java.net.SocketTimeoutException; | | 51 | 52 | import java.net.UnknownHostException; | | 52 | 53 | import java.net.URL; | | 53 | 54 | import java.security.CodeSource; |
| | @@ -105,6 +106,13 @@ | | 105 | 106 | * localhost and will expect to receive the key specified in a property | | 106 | 107 | * named "wrapper.key". | | 107 | 108 | * | | 109 | + * When the backend connection is a socket, it does not have any timeout | | 110 | + * set by default. For testing purposes it is possible to set a timeout | | 111 | + * in seconds using the following system property when launching the JVM. | | 112 | + * This will only be noticeable if it is shorter than the ping interval, | | 113 | + * and debug output is enabled: | | 114 | + * -Dwrapper.backend.ro_timeout=300 | | 115 | + * | | 108 | 116 | * This class is implemented as a singleton class. | | 109 | 117 | * | | 110 | 118 | * Generate JNI Headers with the following command in the build/classes |
| | @@ -119,7 +127,6 @@ | | 119 | 127 | private static final String WRAPPER_CONNECTION_THREAD_NAME = "Wrapper-Connection"; | | 120 | 128 | | | 121 | 129 | private static final int DEFAULT_PORT = 15003; | | 122 | | - private static final int DEFAULT_SO_TIMEOUT = 10000; | | 123 | 130 | private static final int DEFAULT_CPU_TIMEOUT = 10000; | | 124 | 131 | | | 125 | 132 | /** The number of milliseconds in one tick. Used for internal system |
| | @@ -317,6 +324,7 @@ | | 317 | 324 | private static int m_jvmPortMin; | | 318 | 325 | private static int m_jvmPortMax; | | 319 | 326 | private static String m_key; | | 327 | + private static int m_soTimeout = 0; | | 320 | 328 | private static long m_cpuTimeout = DEFAULT_CPU_TIMEOUT; | | 321 | 329 | | | 322 | 330 | /** Tick count when the start method completed. */ |
| | @@ -630,6 +638,9 @@ | | 630 | 638 | m_listenerForceStop = WrapperSystemPropertyUtil.getBooleanProperty( | | 631 | 639 | "wrapper.listener.force_stop", false ); | | 632 | 640 | | | 641 | + // Make it possible for a user to set the SO_TIMEOUT of the backend. Mainly for testing. | | 642 | + m_soTimeout = WrapperSystemPropertyUtil.getIntProperty( "wrapper.backend.so_timeout", 0 ) * 1000; | | 643 | + | | 633 | 644 | // If the shutdown hook is not disabled, then register it. | | 634 | 645 | if ( !disableShutdownHook ) | | 635 | 646 | { |
| | @@ -2182,7 +2193,7 @@ | | 2182 | 2193 | } | | 2183 | 2194 | | | 2184 | 2195 | /** | | 2185 | | - * Returns true if the current JVM is Windows. | | 2196 | + * Returns true if the current JVM is Mac OSX. | | 2186 | 2197 | * | | 2187 | 2198 | * @return True if this is Mac OSX. | | 2188 | 2199 | * |
| | @@ -4741,6 +4752,18 @@ | | 4741 | 4752 | // Turn on the TCP_NODELAY flag. This is very important for speed!! | | 4742 | 4753 | m_backendSocket.setTcpNoDelay( true ); | | 4743 | 4754 | | | 4755 | + // If configured, set the SO_TIMEOUT for the socket (max block time) | | 4756 | + if ( m_soTimeout > 0 ) | | 4757 | + { | | 4758 | + if ( m_debug ) | | 4759 | + { | | 4760 | + m_outDebug.println( getRes().getString( "Setting backend socket SO_TIMEOUT to {0}ms from {1}ms.", | | 4761 | + new Integer( m_soTimeout ), new Integer( m_backendSocket.getSoTimeout() ) ) ); | | 4762 | + } | | 4763 | + | | 4764 | + m_backendSocket.setSoTimeout( m_soTimeout ); | | 4765 | + } | | 4766 | + | | 4744 | 4767 | m_backendOS = m_backendSocket.getOutputStream(); | | 4745 | 4768 | m_backendIS = m_backendSocket.getInputStream(); | | 4746 | 4769 | } |
| | @@ -5099,219 +5122,230 @@ | | 5099 | 5122 | DataInputStream is = new DataInputStream( m_backendIS ); | | 5100 | 5123 | while ( !m_disposed ) | | 5101 | 5124 | { | | 5102 | | - // A Packet code must exist. | | 5103 | | - byte code = is.readByte(); | | 5104 | | - | | 5105 | | - // Always read from the buffer until a null '\0' is encountered. | | 5106 | | - byte b; | | 5107 | | - int i = 0; | | 5108 | | - do | | 5125 | + try | | 5109 | 5126 | { | | 5110 | | - b = is.readByte(); | | 5111 | | - if ( b != 0 ) | | 5127 | + // A Packet code must exist. | | 5128 | + byte code = is.readByte(); | | 5129 | + | | 5130 | + // Always read from the buffer until a null '\0' is encountered. | | 5131 | + byte b; | | 5132 | + int i = 0; | | 5133 | + do | | 5112 | 5134 | { | | 5113 | | - if ( i >= m_backendReadBuffer.length ) | | 5135 | + b = is.readByte(); | | 5136 | + if ( b != 0 ) | | 5114 | 5137 | { | | 5115 | | - byte[] tmp = m_backendReadBuffer; | | 5116 | | - m_backendReadBuffer = new byte[tmp.length + 256]; | | 5117 | | - System.arraycopy( tmp, 0, m_backendReadBuffer, 0, tmp.length ); | | 5138 | + if ( i >= m_backendReadBuffer.length ) | | 5139 | + { | | 5140 | + byte[] tmp = m_backendReadBuffer; | | 5141 | + m_backendReadBuffer = new byte[tmp.length + 256]; | | 5142 | + System.arraycopy( tmp, 0, m_backendReadBuffer, 0, tmp.length ); | | 5143 | + } | | 5144 | + m_backendReadBuffer[i] = b; | | 5145 | + i++; | | 5118 | 5146 | } | | 5119 | | - m_backendReadBuffer[i] = b; | | 5120 | | - i++; | | 5121 | 5147 | } | | 5122 | | - } | | 5123 | | - while ( b != 0 ); | | 5124 | | - | | 5125 | | - String msg = new String( m_backendReadBuffer, 0, i ); | | 5126 | | - | | 5127 | | - if ( m_appearHung ) | | 5128 | | - { | | 5129 | | - // The WrapperManager is attempting to make the JVM appear hung, | | 5130 | | - // so ignore all incoming requests | | 5131 | | - } | | 5132 | | - else | | 5133 | | - { | | 5134 | | - if ( m_debug ) | | 5148 | + while ( b != 0 ); | | 5149 | + | | 5150 | + String msg = new String( m_backendReadBuffer, 0, i ); | | 5151 | + | | 5152 | + if ( m_appearHung ) | | 5135 | 5153 | { | | 5136 | | - String logMsg; | | 5137 | | - if ( code == WRAPPER_MSG_PROPERTIES ) | | 5138 | | - { | | 5139 | | - // The property values are very large and distracting in the log. | | 5140 | | - // Plus if any triggers are defined, then logging them will fire | | 5141 | | - // the trigger. | | 5142 | | - logMsg = getRes().getString( "(Property Values)" ); | | 5143 | | - } | | 5144 | | - else | | 5145 | | - { | | 5146 | | - logMsg = msg; | | 5147 | | - } | | 5148 | | - | | 5149 | | - // Don't log silent pings. | | 5150 | | - if ( ( code == WRAPPER_MSG_PING ) && ( msg.equals( "silent" ) ) ) | | 5151 | | - { | | 5152 | | - //m_outDebug.println( "Received silent ping packet." ); | | 5153 | | - } | | 5154 | | - else | | 5155 | | - { | | 5156 | | - m_outDebug.println( getRes().getString( "Received a packet {0} : {1}", | | 5157 | | - getPacketCodeName( code ) , logMsg ) ); | | 5158 | | - } | | 5154 | + // The WrapperManager is attempting to make the JVM appear hung, | | 5155 | + // so ignore all incoming requests | | 5159 | 5156 | } | | 5160 | | - | | 5161 | | - // Ok, we got a packet. Do something with it. | | 5162 | | - switch( code ) | | 5157 | + else | | 5163 | 5158 | { | | 5164 | | - case WRAPPER_MSG_START: | | 5165 | | - // Don't start if we are already starting to stop. | | 5166 | | - if ( m_stoppingInit) { | | 5167 | | - if ( m_debug ) | | 5159 | + if ( m_debug ) | | 5160 | + { | | 5161 | + String logMsg; | | 5162 | + if ( code == WRAPPER_MSG_PROPERTIES ) | | 5168 | 5163 | { | | 5169 | | - m_outDebug.println( getRes().getString( "Java stop initiated. Skipping application startup." ) ); | | 5164 | + // The property values are very large and distracting in the log. | | 5165 | + // Plus if any triggers are defined, then logging them will fire | | 5166 | + // the trigger. | | 5167 | + logMsg = getRes().getString( "(Property Values)" ); | | 5170 | 5168 | } | | 5171 | | - } else { | | 5172 | | - startInner( false ); | | 5173 | | - } | | 5174 | | - break; | | 5175 | | - | | 5176 | | - case WRAPPER_MSG_STOP: | | 5177 | | - // Don't do anything if we are already stopping | | 5178 | | - if ( !m_stopping ) | | 5179 | | - { | | 5180 | | - privilegedStopInner( 0 ); | | 5181 | | - // Should never get back here. | | 5182 | | - } | | 5183 | | - break; | | 5184 | | - | | 5185 | | - case WRAPPER_MSG_PING: | | 5186 | | - m_lastPingTicks = getTicks(); | | 5187 | | - | | 5188 | | - sendCommand( WRAPPER_MSG_PING, msg ); | | 5189 | | - | | 5190 | | - if ( m_produceCoreEvents ) | | 5191 | | - { | | 5192 | | - fireWrapperEvent( pingEvent ); | | 5193 | | - } | | 5194 | | - | | 5195 | | - break; | | 5196 | | - | | 5197 | | - case WRAPPER_MSG_CHECK_DEADLOCK: | | 5198 | | - boolean deadLocked = checkDeadlocks(); | | 5199 | | - if ( deadLocked ) | | 5200 | | - { | | 5201 | | - sendCommand( WRAPPER_MSG_DEADLOCK, "deadLock" ); | | 5202 | | - } | | 5203 | | - break; | | 5204 | | - | | 5205 | | - case WRAPPER_MSG_BADKEY: | | 5206 | | - // The key sent to the wrapper was incorrect. We need to shutdown. | | 5207 | | - m_outError.println( getRes().getString("Authorization key rejected by Wrapper." ) ); | | 5208 | | - m_outError.println( getRes().getString( "Exiting JVM..." ) ); | | 5209 | | - closeBackend(); | | 5210 | | - privilegedStopInner( 1 ); | | 5211 | | - break; | | 5212 | | - | | 5213 | | - case WRAPPER_MSG_LOW_LOG_LEVEL: | | 5214 | | - try | | 5215 | | - { | | 5216 | | - m_lowLogLevel = Integer.parseInt( msg ); | | 5217 | | - m_debug = ( m_lowLogLevel <= WRAPPER_LOG_LEVEL_DEBUG ); | | 5218 | | - if ( m_debug ) | | 5169 | + else | | 5219 | 5170 | { | | 5220 | | - m_outDebug.println( getRes().getString( "LowLogLevel from Wrapper is {0}", | | 5221 | | - new Integer( m_lowLogLevel ) ) ); | | 5171 | + logMsg = msg; | | 5222 | 5172 | } | | 5223 | | - } | | 5224 | | - catch ( NumberFormatException e ) | | 5225 | | - { | | 5226 | | - m_outError.println( getRes().getString( | | 5227 | | - "Encountered an Illegal LowLogLevel from the Wrapper: {0}", msg ) ); | | 5228 | | - } | | 5229 | | - break; | | 5230 | | - | | 5231 | | - case WRAPPER_MSG_PING_TIMEOUT: | | 5232 | | - /* No longer used. This is still here in case a mix of versions are used. */ | | 5233 | | - break; | | 5234 | | - | | 5235 | | - case WRAPPER_MSG_SERVICE_CONTROL_CODE: | | 5236 | | - try | | 5237 | | - { | | 5238 | | - int serviceControlCode = Integer.parseInt( msg ); | | 5239 | | - if ( m_debug ) | | 5173 | + | | 5174 | + // Don't log silent pings. | | 5175 | + if ( ( code == WRAPPER_MSG_PING ) && ( msg.equals( "silent" ) ) ) | | 5240 | 5176 | { | | 5241 | | - m_outDebug.println( getRes().getString( | | 5242 | | - "ServiceControlCode from Wrapper with code {0}", | | 5243 | | - new Integer( serviceControlCode ) ) ); | | 5177 | + //m_outDebug.println( "Received silent ping packet." ); | | 5244 | 5178 | } | | 5245 | | - WrapperServiceControlEvent event = | | 5246 | | - new WrapperServiceControlEvent( serviceControlCode ); | | 5247 | | - fireWrapperEvent( event ); | | 5248 | | - } | | 5249 | | - catch ( NumberFormatException e ) | | 5250 | | - { | | 5251 | | - m_outError.println( getRes().getString( | | 5252 | | - "Encountered an Illegal ServiceControlCode from the Wrapper: {0}", msg ) ); | | 5253 | | - } | | 5254 | | - break; | | 5255 | | - | | 5256 | | - case WRAPPER_MSG_PAUSE: | | 5257 | | - try | | 5258 | | - { | | 5259 | | - int actionCode = Integer.parseInt( msg ); | | 5260 | | - if ( m_debug ) | | 5179 | + else | | 5261 | 5180 | { | | 5262 | | - m_outDebug.println( getRes().getString( "Pause from Wrapper with code {0}", new Integer( actionCode ) ) ); | | 5181 | + m_outDebug.println( getRes().getString( "Received a packet {0} : {1}", | | 5182 | + getPacketCodeName( code ) , logMsg ) ); | | 5263 | 5183 | } | | 5264 | | - WrapperServicePauseEvent event = | | 5265 | | - new WrapperServicePauseEvent( actionCode ); | | 5266 | | - fireWrapperEvent( event ); | | 5267 | 5184 | } | | 5268 | | - catch ( NumberFormatException e ) | | 5269 | | - { | | 5270 | | - m_outError.println( getRes().getString( | | 5271 | | - "Encountered an Illegal ActionCode from the Wrapper: {0}", msg ) ); | | 5272 | | - } | | 5273 | | - break; | | 5274 | 5185 | | | 5275 | | - case WRAPPER_MSG_RESUME: | | 5276 | | - try | | 5186 | + // Ok, we got a packet. Do something with it. | | 5187 | + switch( code ) | | 5277 | 5188 | { | | 5278 | | - int actionCode = Integer.parseInt( msg ); | | 5279 | | - if ( m_debug ) | | 5189 | + case WRAPPER_MSG_START: | | 5190 | + // Don't start if we are already starting to stop. | | 5191 | + if ( m_stoppingInit) { | | 5192 | + if ( m_debug ) | | 5193 | + { | | 5194 | + m_outDebug.println( getRes().getString( "Java stop initiated. Skipping application startup." ) ); | | 5195 | + } | | 5196 | + } else { | | 5197 | + startInner( false ); | | 5198 | + } | | 5199 | + break; | | 5200 | + | | 5201 | + case WRAPPER_MSG_STOP: | | 5202 | + // Don't do anything if we are already stopping | | 5203 | + if ( !m_stopping ) | | 5280 | 5204 | { | | 5281 | | - m_outDebug.println( getRes().getString("Resume from Wrapper with code {0}", new Integer( actionCode ) ) ); | | 5205 | + privilegedStopInner( 0 ); | | 5206 | + // Should never get back here. | | 5282 | 5207 | } | | 5283 | | - WrapperServiceResumeEvent event = | | 5284 | | - new WrapperServiceResumeEvent( actionCode ); | | 5208 | + break; | | 5209 | + | | 5210 | + case WRAPPER_MSG_PING: | | 5211 | + m_lastPingTicks = getTicks(); | | 5212 | + | | 5213 | + sendCommand( WRAPPER_MSG_PING, msg ); | | 5214 | + | | 5215 | + if ( m_produceCoreEvents ) | | 5216 | + { | | 5217 | + fireWrapperEvent( pingEvent ); | | 5218 | + } | | 5219 | + | | 5220 | + break; | | 5221 | + | | 5222 | + case WRAPPER_MSG_CHECK_DEADLOCK: | | 5223 | + boolean deadLocked = checkDeadlocks(); | | 5224 | + if ( deadLocked ) | | 5225 | + { | | 5226 | + sendCommand( WRAPPER_MSG_DEADLOCK, "deadLock" ); | | 5227 | + } | | 5228 | + break; | | 5229 | + | | 5230 | + case WRAPPER_MSG_BADKEY: | | 5231 | + // The key sent to the wrapper was incorrect. We need to shutdown. | | 5232 | + m_outError.println( getRes().getString("Authorization key rejected by Wrapper." ) ); | | 5233 | + m_outError.println( getRes().getString( "Exiting JVM..." ) ); | | 5234 | + closeBackend(); | | 5235 | + privilegedStopInner( 1 ); | | 5236 | + break; | | 5237 | + | | 5238 | + case WRAPPER_MSG_LOW_LOG_LEVEL: | | 5239 | + try | | 5240 | + { | | 5241 | + m_lowLogLevel = Integer.parseInt( msg ); | | 5242 | + m_debug = ( m_lowLogLevel <= WRAPPER_LOG_LEVEL_DEBUG ); | | 5243 | + if ( m_debug ) | | 5244 | + { | | 5245 | + m_outDebug.println( getRes().getString( "LowLogLevel from Wrapper is {0}", | | 5246 | + new Integer( m_lowLogLevel ) ) ); | | 5247 | + } | | 5248 | + } | | 5249 | + catch ( NumberFormatException e ) | | 5250 | + { | | 5251 | + m_outError.println( getRes().getString( | | 5252 | + "Encountered an Illegal LowLogLevel from the Wrapper: {0}", msg ) ); | | 5253 | + } | | 5254 | + break; | | 5255 | + | | 5256 | + case WRAPPER_MSG_PING_TIMEOUT: | | 5257 | + /* No longer used. This is still here in case a mix of versions are used. */ | | 5258 | + break; | | 5259 | + | | 5260 | + case WRAPPER_MSG_SERVICE_CONTROL_CODE: | | 5261 | + try | | 5262 | + { | | 5263 | + int serviceControlCode = Integer.parseInt( msg ); | | 5264 | + if ( m_debug ) | | 5265 | + { | | 5266 | + m_outDebug.println( getRes().getString( | | 5267 | + "ServiceControlCode from Wrapper with code {0}", | | 5268 | + new Integer( serviceControlCode ) ) ); | | 5269 | + } | | 5270 | + WrapperServiceControlEvent event = | | 5271 | + new WrapperServiceControlEvent( serviceControlCode ); | | 5272 | + fireWrapperEvent( event ); | | 5273 | + } | | 5274 | + catch ( NumberFormatException e ) | | 5275 | + { | | 5276 | + m_outError.println( getRes().getString( | | 5277 | + "Encountered an Illegal ServiceControlCode from the Wrapper: {0}", msg ) ); | | 5278 | + } | | 5279 | + break; | | 5280 | + | | 5281 | + case WRAPPER_MSG_PAUSE: | | 5282 | + try | | 5283 | + { | | 5284 | + int actionCode = Integer.parseInt( msg ); | | 5285 | + if ( m_debug ) | | 5286 | + { | | 5287 | + m_outDebug.println( getRes().getString( "Pause from Wrapper with code {0}", new Integer( actionCode ) ) ); | | 5288 | + } | | 5289 | + WrapperServicePauseEvent event = | | 5290 | + new WrapperServicePauseEvent( actionCode ); | | 5291 | + fireWrapperEvent( event ); | | 5292 | + } | | 5293 | + catch ( NumberFormatException e ) | | 5294 | + { | | 5295 | + m_outError.println( getRes().getString( | | 5296 | + "Encountered an Illegal ActionCode from the Wrapper: {0}", msg ) ); | | 5297 | + } | | 5298 | + break; | | 5299 | + | | 5300 | + case WRAPPER_MSG_RESUME: | | 5301 | + try | | 5302 | + { | | 5303 | + int actionCode = Integer.parseInt( msg ); | | 5304 | + if ( m_debug ) | | 5305 | + { | | 5306 | + m_outDebug.println( getRes().getString("Resume from Wrapper with code {0}", new Integer( actionCode ) ) ); | | 5307 | + } | | 5308 | + WrapperServiceResumeEvent event = | | 5309 | + new WrapperServiceResumeEvent( actionCode ); | | 5310 | + fireWrapperEvent( event ); | | 5311 | + } | | 5312 | + catch ( NumberFormatException e ) | | 5313 | + { | | 5314 | + m_outError.println( getRes().getString( | | 5315 | + "Encountered an Illegal ActionCode from the Wrapper: {0}", msg ) ); | | 5316 | + } | | 5317 | + break; | | 5318 | + | | 5319 | + case WRAPPER_MSG_GC: | | 5320 | + System.gc(); | | 5321 | + break; | | 5322 | + | | 5323 | + case WRAPPER_MSG_PROPERTIES: | | 5324 | + readProperties( msg ); | | 5325 | + break; | | 5326 | + | | 5327 | + case WRAPPER_MSG_LOGFILE: | | 5328 | + m_logFile = new File( msg ); | | 5329 | + WrapperLogFileChangedEvent event = new WrapperLogFileChangedEvent( m_logFile ); | | 5285 | 5330 | fireWrapperEvent( event ); | | 5331 | + break; | | 5332 | + | | 5333 | + default: | | 5334 | + // Ignore unknown messages | | 5335 | + m_outInfo.println( getRes().getString( | | 5336 | + "Wrapper code received an unknown packet type: {0}", new Integer( code ) ) ); | | 5337 | + break; | | 5286 | 5338 | } | | 5287 | | - catch ( NumberFormatException e ) | | 5288 | | - { | | 5289 | | - m_outError.println( getRes().getString( | | 5290 | | - "Encountered an Illegal ActionCode from the Wrapper: {0}", msg ) ); | | 5291 | | - } | | 5292 | | - break; | | 5293 | | - | | 5294 | | - case WRAPPER_MSG_GC: | | 5295 | | - System.gc(); | | 5296 | | - break; | | 5297 | | - | | 5298 | | - case WRAPPER_MSG_PROPERTIES: | | 5299 | | - readProperties( msg ); | | 5300 | | - break; | | 5301 | | - | | 5302 | | - case WRAPPER_MSG_LOGFILE: | | 5303 | | - m_logFile = new File( msg ); | | 5304 | | - WrapperLogFileChangedEvent event = new WrapperLogFileChangedEvent( m_logFile ); | | 5305 | | - fireWrapperEvent( event ); | | 5306 | | - break; | | 5307 | | - | | 5308 | | - default: | | 5309 | | - // Ignore unknown messages | | 5310 | | - m_outInfo.println( getRes().getString( | | 5311 | | - "Wrapper code received an unknown packet type: {0}", new Integer( code ) ) ); | | 5312 | | - break; | | 5313 | 5339 | } | | 5314 | 5340 | } | | 5341 | + catch ( SocketTimeoutException e ) | | 5342 | + { | | 5343 | + if ( m_debug ) | | 5344 | + { | | 5345 | + m_outDebug.println( getRes().getString( "Backend socket timed out. Attempting to continue. (SO_TIMEOUT={0}ms.)", | | 5346 | + new Integer( m_backendSocket.getSoTimeout() ) ) ); | | 5347 | + } | | 5348 | + } | | 5315 | 5349 | } | | 5316 | 5350 | if ( m_debug ) | | 5317 | 5351 | { |
| | @@ -411,10 +411,17 @@ | | 411 | 411 | * filename: File to write to. | | 412 | 412 | * pid: pid to write in the file. | | 413 | 413 | */ | | 414 | | -int writePidFile(const TCHAR *filename, DWORD pid, int newUmask) { | | 414 | +int writePidFile(const TCHAR *filename, DWORD pid, int newUmask, int exclusive) { | | 415 | 415 | FILE *pid_fp = NULL; | | 416 | 416 | int old_umask; | | 417 | 417 | | | 418 | + if (getBooleanProperty(properties, TEXT("wrapper.pidfile.strict"), FALSE, FALSE) == TRUE && | | 419 | + exclusive == TRUE && file_exists(filename)) { | | 420 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, | | 421 | + TEXT("%d pid file, %s, already exists."), pid, filename); | | 422 | + cleanUpPIDFilesOnExit = FALSE; | | 423 | + return 1; | | 424 | + } | | 418 | 425 | old_umask = _umask(newUmask); | | 419 | 426 | pid_fp = _tfopen(filename, TEXT("w")); | | 420 | 427 | _umask(old_umask); |
| | @@ -1811,7 +1818,7 @@ | | 1811 | 1818 | | | 1812 | 1819 | /* If a java pid filename is specified then write the pid of the java process. */ | | 1813 | 1820 | if (wrapperData->javaPidFilename) { | | 1814 | | - if (writePidFile(wrapperData->javaPidFilename, wrapperData->javaPID, wrapperData->javaPidFileUmask)) { | | 1821 | + if (writePidFile(wrapperData->javaPidFilename, wrapperData->javaPID, wrapperData->javaPidFileUmask, FALSE)) { | | 1815 | 1822 | log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_WARN, | | 1816 | 1823 | TEXT("Unable to write the Java PID file: %s"), wrapperData->javaPidFilename); | | 1817 | 1824 | } |
| | @@ -1819,7 +1826,7 @@ | | 1819 | 1826 | | | 1820 | 1827 | /* If a java id filename is specified then write the id of the java process. */ | | 1821 | 1828 | if (wrapperData->javaIdFilename) { | | 1822 | | - if (writePidFile(wrapperData->javaIdFilename, wrapperData->jvmRestarts, wrapperData->javaIdFileUmask)) { | | 1829 | + if (writePidFile(wrapperData->javaIdFilename, wrapperData->jvmRestarts, wrapperData->javaIdFileUmask, FALSE)) { | | 1823 | 1830 | log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_WARN, | | 1824 | 1831 | TEXT("Unable to write the Java Id file: %s"), wrapperData->javaIdFilename); | | 1825 | 1832 | } |
| | @@ -3160,32 +3167,23 @@ | | 3160 | 3167 | #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) | | 3161 | 3168 | #endif | | 3162 | 3169 | | | 3163 | | -LSA_UNICODE_STRING InitLsaString(TCHAR* pwszString) { | | 3164 | | - USHORT dwLen = 0; | | 3165 | | - LSA_UNICODE_STRING pLsaString; | | 3170 | +void InitLsaString(PLSA_UNICODE_STRING LsaString, LPWSTR String) { | | 3171 | + size_t StringLength; | | 3166 | 3172 | | | 3167 | | - if ((pwszString != NULL) && ((dwLen = (USHORT)wcslen(pwszString)) > 0)) { | | 3168 | | - pLsaString.Buffer = (WCHAR*)pwszString; | | 3169 | | - } | | 3170 | | - pLsaString.Length = dwLen * sizeof(wchar_t); | | 3171 | | - pLsaString.MaximumLength= (dwLen+1) * sizeof(wchar_t); | | 3172 | | - return pLsaString; | | 3173 | | -} | | 3174 | | - | | 3175 | | - | | 3176 | | -BOOL AllocWStrFromLSAStr(PWSTR *ppwstrTarget, LSA_UNICODE_STRING LsaStr) { | | 3177 | | - *ppwstrTarget = (PWSTR)LocalAlloc(0,LsaStr.Length + sizeof(WCHAR)); | | 3178 | | - if (*ppwstrTarget == NULL) { | | 3179 | | - return FALSE; | | 3173 | + if (String == NULL) { | | 3174 | + LsaString->Buffer = NULL; | | 3175 | + LsaString->Length = 0; | | 3176 | + LsaString->MaximumLength = 0; | | 3177 | + return; | | 3180 | 3178 | } | | 3181 | | - memcpy(*ppwstrTarget,LsaStr.Buffer,LsaStr.Length); | | 3182 | | - (*ppwstrTarget)[LsaStr.Length] = TEXT('\0'); | | 3183 | 3179 | | | 3184 | | - return TRUE; | | 3180 | + StringLength = wcslen(String); | | 3181 | + LsaString->Buffer = String; | | 3182 | + LsaString->Length = (USHORT) StringLength * sizeof(WCHAR); | | 3183 | + LsaString->MaximumLength=(USHORT)(StringLength+1) * sizeof(WCHAR); | | 3185 | 3184 | } | | 3186 | 3185 | | | 3187 | | - | | 3188 | | -NTSTATUS OpenPolicy(TCHAR* ServerName, DWORD DesiredAccess, PLSA_HANDLE PolicyHandle) { | | 3186 | +NTSTATUS OpenPolicy(LPWSTR ServerName, DWORD DesiredAccess, PLSA_HANDLE PolicyHandle) { | | 3189 | 3187 | LSA_OBJECT_ATTRIBUTES ObjectAttributes; | | 3190 | 3188 | LSA_UNICODE_STRING ServerString; | | 3191 | 3189 | PLSA_UNICODE_STRING Server = NULL; |
| | @@ -3193,16 +3191,17 @@ | | 3193 | 3191 | ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes)); | | 3194 | 3192 | | | 3195 | 3193 | if (ServerName != NULL) { | | 3196 | | - ServerString = InitLsaString(ServerName); | | 3194 | + InitLsaString(&ServerString, ServerName); | | 3197 | 3195 | Server = &ServerString; | | 3198 | 3196 | } | | 3199 | 3197 | | | 3200 | | - return LsaOpenPolicy(Server, &ObjectAttributes, | | 3201 | | - DesiredAccess, PolicyHandle); | | 3198 | + return LsaOpenPolicy(Server, &ObjectAttributes, DesiredAccess, PolicyHandle); | | 3202 | 3199 | } | | 3203 | 3200 | | | 3201 | + | | 3204 | 3202 | /* | | 3205 | 3203 | * Checks if pc is part of Domain, workgroup or standalone | | 3204 | + * @returns 1 if it's part of Domain, 2 for workgroup, 3 for stand alone, 0 if there was an error | | 3206 | 3205 | */ | | 3207 | 3206 | int checkDomain() { | | 3208 | 3207 | LSA_HANDLE PolicyHandle; |
| | @@ -3210,31 +3209,55 @@ | | 3210 | 3209 | PPOLICY_PRIMARY_DOMAIN_INFO ppdiDomainInfo; | | 3211 | 3210 | PWKSTA_INFO_100 pwkiWorkstationInfo; | | 3212 | 3211 | DWORD netret; | | 3213 | | - PWSTR ResName; | | 3212 | + wchar_t* ResName; | | 3214 | 3213 | int ret = 0; | | 3215 | 3214 | | | 3216 | 3215 | netret = NetWkstaGetInfo(NULL, 100, (LPBYTE *)&pwkiWorkstationInfo); | | 3216 | +#ifdef _DEBUG | | 3217 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("checkDomain: NetWkstaGetInfo returned %d"), netret); | | 3218 | +#endif | | 3217 | 3219 | if (netret == NERR_Success) { | | 3218 | 3220 | status = OpenPolicy(NULL, GENERIC_READ | POLICY_VIEW_LOCAL_INFORMATION, &PolicyHandle); | | 3221 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("checkDomain: OpenPolicy returned %d\n"), status); | | 3219 | 3222 | if (!status) { | | 3223 | +#ifdef _DEBUG | | 3224 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("checkDomain: LsaQueryInformationPolicy call ahead"));fflush(NULL); | | 3225 | +#endif | | 3220 | 3226 | status = LsaQueryInformationPolicy(PolicyHandle, PolicyPrimaryDomainInformation, &ppdiDomainInfo); | | 3227 | +#ifdef _DEBUG | | 3228 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("checkDomain: LsaQueryInformationPolicy returned %d"), status); | | 3229 | +#endif | | 3221 | 3230 | if (!status) { | | 3222 | | - AllocWStrFromLSAStr(&ResName, ppdiDomainInfo->Name); | | 3223 | | - if (ppdiDomainInfo->Sid) { | | 3224 | | - ret = 1; | | 3225 | | - } else { | | 3226 | | - if (_tcsncmp(ResName, (LPWSTR)pwkiWorkstationInfo->wki100_computername, | | 3227 | | - wcslen((LPWSTR)pwkiWorkstationInfo->wki100_computername))) { | | 3228 | | - ret = 2; | | 3231 | +#ifdef _DEBUG | | 3232 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, | | 3233 | + TEXT("checkDomain: LsaQueryInformationPolicy:ppdiDomainInfo->maxlen = %d, len=%d, buffer=%s, strlen=%d"), | | 3234 | + ppdiDomainInfo->Name.MaximumLength,ppdiDomainInfo->Name.Length ,ppdiDomainInfo->Name.Buffer, wcslen(ppdiDomainInfo->Name.Buffer)); | | 3235 | +#endif | | 3236 | + ResName = malloc((wcslen(ppdiDomainInfo->Name.Buffer) + 1 ) * sizeof(wchar_t)); | | 3237 | + if (ResName) { | | 3238 | + _tcsncpy(ResName, ppdiDomainInfo->Name.Buffer, wcslen(ppdiDomainInfo->Name.Buffer) + 1); | | 3239 | + if (ppdiDomainInfo->Sid) { | | 3240 | + ret = 1; | | 3229 | 3241 | } else { | | 3230 | | - ret = 3; | | 3242 | +#ifdef _DEBUG | | 3243 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, | | 3244 | + TEXT("checkDomain: comparing %s vs. %s"), ResName, | | 3245 | + pwkiWorkstationInfo->wki100_computername); | | 3246 | +#endif | | 3247 | + if (_tcsncmp(ResName, pwkiWorkstationInfo->wki100_computername, | | 3248 | + wcslen(pwkiWorkstationInfo->wki100_computername))) { | | 3249 | + ret = 2; | | 3250 | + } else { | | 3251 | + ret = 3; | | 3252 | + } | | 3231 | 3253 | } | | 3254 | + free(ResName); | | 3232 | 3255 | } | | 3233 | | - LocalFree(ResName); | | 3256 | + LsaFreeMemory((LPVOID)ppdiDomainInfo); | | 3234 | 3257 | } | | 3258 | + LsaClose(PolicyHandle); | | 3235 | 3259 | } | | 3236 | 3260 | NetApiBufferFree(pwkiWorkstationInfo); | | 3237 | | - LsaFreeMemory((LPVOID)ppdiDomainInfo); | | 3238 | 3261 | } | | 3239 | 3262 | return ret; | | 3240 | 3263 | } |
| | @@ -3252,15 +3275,30 @@ | | 3252 | 3275 | int k; | | 3253 | 3276 | | | 3254 | 3277 | k = checkDomain(); | | 3278 | +#ifdef _DEBUG | | 3279 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("checkDomain returns %d."), k); | | 3280 | +#endif | | 3255 | 3281 | if (k > 0) { | | 3256 | 3282 | if (k > 1) { | | 3283 | +#ifdef _DEBUG | | 3284 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("OpenPolicy call %s "), referencedDomainName); | | 3285 | +#endif | | 3257 | 3286 | ntsResult = OpenPolicy(referencedDomainName, /* Name of the target system. */ | | 3258 | 3287 | POLICY_LOOKUP_NAMES | POLICY_CREATE_ACCOUNT, /* Desired access permissions. */ | | 3259 | 3288 | &lsahPolicyHandle); /*Receives the policy handle. */ | | 3289 | +#ifdef _DEBUG | | 3290 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("OpenPolicy returns %d."), ntsResult); | | 3291 | +#endif | | 3260 | 3292 | } else { | | 3293 | +#ifdef _DEBUG | | 3294 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("OpenPolicy call NULL.")); | | 3295 | +#endif | | 3261 | 3296 | ntsResult = OpenPolicy(NULL, /* Name of the target system. */ | | 3262 | 3297 | POLICY_LOOKUP_NAMES | POLICY_CREATE_ACCOUNT, /* Desired access permissions. */ | | 3263 | 3298 | &lsahPolicyHandle); /*Receives the policy handle. */ | | 3299 | +#ifdef _DEBUG | | 3300 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("OpenPolicy returns %d."), ntsResult); | | 3301 | +#endif | | 3264 | 3302 | } | | 3265 | 3303 | if (ntsResult != STATUS_SUCCESS) { | | 3266 | 3304 | /* An error occurred. Display it as a win32 error code. */ |
| | @@ -3284,29 +3322,39 @@ | | 3284 | 3322 | SID_NAME_USE eUse; | | 3285 | 3323 | LPCTSTR formattedAccountName; | | 3286 | 3324 | | | 3325 | +#ifdef _DEBUG | | 3326 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("lookupname: %s"), lpszAccountName); | | 3327 | +#endif | | 3287 | 3328 | if (_tcsstr(lpszAccountName, TEXT(".\\")) == lpszAccountName) { | | 3288 | 3329 | formattedAccountName = lpszAccountName + 2; | | 3289 | 3330 | } else { | | 3290 | 3331 | formattedAccountName= lpszAccountName; | | 3291 | 3332 | } | | 3292 | 3333 | | | 3334 | +#ifdef _DEBUG | | 3335 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("lookupname:formatedname %s"), formattedAccountName); | | 3336 | +#endif | | 3337 | + | | 3293 | 3338 | cbReferencedDomainName = cbSid = 0; | | 3294 | | - if (LookupAccountName(NULL, formattedAccountName, 0, &cbSid, 0, &cbReferencedDomainName, &eUse)) { | | 3339 | + if (LookupAccountName(NULL, formattedAccountName, NULL, &cbSid, NULL, &cbReferencedDomainName, &eUse)) { | | 3295 | 3340 | /* A straight success - that can't be... */ | | 3296 | 3341 | return 0; | | 3297 | 3342 | } | | 3298 | 3343 | lastError = GetLastError(); | | 3299 | 3344 | if (lastError != ERROR_INSUFFICIENT_BUFFER) { | | 3300 | 3345 | /* Any error except the one above is fatal.. */ | | 3301 | | - log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, TEXT("Failed to lookup the account (%s): %d - %s\n"), lpszAccountName, lastError, getLastErrorText()); | | 3346 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, TEXT("Failed to lookup the account (%s): %d - %s"), lpszAccountName, lastError, getLastErrorText()); | | 3302 | 3347 | return 0; | | 3303 | 3348 | } | | 3349 | +#ifdef _DEBUG | | 3350 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("lookupname:cbSID %d ; cbDomain %d"), cbSid, cbReferencedDomainName); | | 3351 | +#endif | | 3304 | 3352 | if (!(Sid = (PSID)malloc(cbSid))) { | | 3305 | 3353 | outOfMemory(TEXT("WLN"), 1); | | 3306 | 3354 | return 0; | | 3307 | 3355 | } | | 3308 | 3356 | | | 3309 | | - *referencedDomainName = (LPTSTR)malloc((cbReferencedDomainName + 1) * sizeof(TCHAR)); | | 3357 | + *referencedDomainName = (LPTSTR)calloc((cbReferencedDomainName ), sizeof(TCHAR)); | | 3310 | 3358 | if (!(*referencedDomainName)) { | | 3311 | 3359 | LocalFree(Sid); | | 3312 | 3360 | outOfMemory(TEXT("WLN"), 2); |
| | @@ -3315,9 +3363,12 @@ | | 3315 | 3363 | if (!LookupAccountName(NULL, formattedAccountName, Sid, &cbSid, *referencedDomainName, &cbReferencedDomainName, &eUse)) { | | 3316 | 3364 | free(*referencedDomainName); | | 3317 | 3365 | free(Sid); | | 3318 | | - log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, TEXT("Failed to lookup the account (%s): %d - %s\n"), lpszAccountName, lastError, getLastErrorText()); | | 3366 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, TEXT("Failed to lookup the account (%s): %d - %s"), lpszAccountName, lastError, getLastErrorText()); | | 3319 | 3367 | return 0; | | 3320 | 3368 | } | | 3369 | +#ifdef _DEBUG | | 3370 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("lookupname:cbreferencedDomain %s"), *referencedDomainName); | | 3371 | +#endif | | 3321 | 3372 | return Sid; | | 3322 | 3373 | } | | 3323 | 3374 | |
| | @@ -3340,22 +3391,26 @@ | | 3340 | 3391 | | | 3341 | 3392 | AccountSID = wrapperLookupName(account, &referencedDomainName); | | 3342 | 3393 | | | 3343 | | - if (AccountSID) { | | 3394 | + if (AccountSID) { | | 3344 | 3395 | if ((PolicyHandle = wrapperGetPolicyHandle(referencedDomainName)) != NULL) { | | 3345 | 3396 | /* Create an LSA_UNICODE_STRING for the privilege names. */ | | 3346 | 3397 | pointer = malloc(sizeof(LSA_UNICODE_STRING)); | | 3347 | | - pointer[0] = InitLsaString(privileges); | | 3348 | | - | | 3349 | | - ntsResult = LsaAddAccountRights(PolicyHandle, /* An open policy handle. */ | | 3350 | | - AccountSID, /* The target SID. */ | | 3351 | | - pointer, /* The privileges. */ | | 3352 | | - counter); /* Number of privileges. */ | | 3353 | | - free(pointer); | | 3354 | | - if (ntsResult == STATUS_SUCCESS) { | | 3355 | | - retVal = FALSE; | | 3398 | + if (pointer == NULL) { | | 3399 | + outOfMemory(TEXT("WAP"), 1); | | 3356 | 3400 | } else { | | 3357 | | - log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, TEXT("Failed to add Logon As Service Permission: %lu\n"), LsaNtStatusToWinError(ntsResult)); | | 3401 | + InitLsaString(pointer, privileges); | | 3402 | + ntsResult = LsaAddAccountRights(PolicyHandle, /* An open policy handle. */ | | 3403 | + AccountSID, /* The target SID. */ | | 3404 | + pointer, /* The privileges. */ | | 3405 | + counter); /* Number of privileges. */ | | 3406 | + free(pointer); | | 3407 | + if (ntsResult == STATUS_SUCCESS) { | | 3408 | + retVal = FALSE; | | 3409 | + } else { | | 3410 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, TEXT("Failed to add Logon As Service Permission: %lu"), LsaNtStatusToWinError(ntsResult)); | | 3411 | + } | | 3358 | 3412 | } | | 3413 | + LsaClose(PolicyHandle); | | 3359 | 3414 | } | | 3360 | 3415 | free(AccountSID); | | 3361 | 3416 | free(referencedDomainName); |
| | @@ -6109,31 +6164,32 @@ | | 6109 | 6164 | rollLogs(); | | 6110 | 6165 | } | | 6111 | 6166 | | | 6112 | | - /* Write pid and anchor files as requested. If they are the same file the file is | | 6113 | | - * simply overwritten. */ | | 6114 | 6167 | cleanUpPIDFilesOnExit = TRUE; | | 6115 | | - if (wrapperData->anchorFilename) { | | 6116 | | - if (writePidFile(wrapperData->anchorFilename, wrapperData->wrapperPID, wrapperData->anchorFileUmask)) { | | 6168 | + if (wrapperData->pidFilename) { | | 6169 | + if (writePidFile(wrapperData->pidFilename, wrapperData->wrapperPID, wrapperData->pidFileUmask, TRUE)) { | | 6117 | 6170 | log_printf | | 6118 | 6171 | (WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 6119 | | - TEXT("ERROR: Could not write anchor file %s: %s"), | | 6120 | | - wrapperData->anchorFilename, getLastErrorText()); | | 6172 | + TEXT("ERROR: Could not write pid file %s: %s"), | | 6173 | + wrapperData->pidFilename, getLastErrorText()); | | 6121 | 6174 | appExit(1); | | 6122 | 6175 | return; /* For clarity. */ | | 6123 | 6176 | } | | 6124 | 6177 | } | | 6125 | | - if (wrapperData->pidFilename) { | | 6126 | | - if (writePidFile(wrapperData->pidFilename, wrapperData->wrapperPID, wrapperData->pidFileUmask)) { | | 6178 | + /* Write pid and anchor files as requested. If they are the same file the file is | | 6179 | + * simply overwritten. */ | | 6180 | + if (wrapperData->anchorFilename) { | | 6181 | + if (writePidFile(wrapperData->anchorFilename, wrapperData->wrapperPID, wrapperData->anchorFileUmask, FALSE)) { | | 6127 | 6182 | log_printf | | 6128 | 6183 | (WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 6129 | | - TEXT("ERROR: Could not write pid file %s: %s"), | | 6130 | | - wrapperData->pidFilename, getLastErrorText()); | | 6184 | + TEXT("ERROR: Could not write anchor file %s: %s"), | | 6185 | + wrapperData->anchorFilename, getLastErrorText()); | | 6131 | 6186 | appExit(1); | | 6132 | 6187 | return; /* For clarity. */ | | 6133 | 6188 | } | | 6134 | 6189 | } | | 6190 | + | | 6135 | 6191 | if (wrapperData->lockFilename) { | | 6136 | | - if (writePidFile(wrapperData->lockFilename, wrapperData->wrapperPID, wrapperData->lockFileUmask)) { | | 6192 | + if (writePidFile(wrapperData->lockFilename, wrapperData->wrapperPID, wrapperData->lockFileUmask, FALSE)) { | | 6137 | 6193 | log_printf | | 6138 | 6194 | (WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 6139 | 6195 | TEXT("ERROR: Could not write lock file %s: %s"), |
| | @@ -6170,27 +6226,29 @@ | | 6170 | 6226 | /* Write pid and anchor files as requested. If they are the same file the file is | | 6171 | 6227 | * simply overwritten. */ | | 6172 | 6228 | cleanUpPIDFilesOnExit = TRUE; | | 6173 | | - if (wrapperData->anchorFilename) { | | 6174 | | - if (writePidFile(wrapperData->anchorFilename, wrapperData->wrapperPID, wrapperData->anchorFileUmask)) { | | 6229 | + if (wrapperData->pidFilename) { | | 6230 | + if (writePidFile(wrapperData->pidFilename, wrapperData->wrapperPID, wrapperData->pidFileUmask, TRUE)) { | | 6175 | 6231 | log_printf | | 6176 | 6232 | (WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 6177 | | - TEXT("ERROR: Could not write anchor file %s: %s"), | | 6178 | | - wrapperData->anchorFilename, getLastErrorText()); | | 6233 | + TEXT("ERROR: Could not write pid file %s: %s"), | | 6234 | + wrapperData->pidFilename, getLastErrorText()); | | 6179 | 6235 | appExit(1); | | 6180 | 6236 | return; /* For clarity. */ | | 6181 | 6237 | } | | 6182 | 6238 | } | | 6183 | | - if (wrapperData->pidFilename) { | | 6184 | | - if (writePidFile(wrapperData->pidFilename, wrapperData->wrapperPID, wrapperData->pidFileUmask)) { | | 6239 | + | | 6240 | + if (wrapperData->anchorFilename) { | | 6241 | + if (writePidFile(wrapperData->anchorFilename, wrapperData->wrapperPID, wrapperData->anchorFileUmask, FALSE)) { | | 6185 | 6242 | log_printf | | 6186 | 6243 | (WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 6187 | | - TEXT("ERROR: Could not write pid file %s: %s"), | | 6188 | | - wrapperData->pidFilename, getLastErrorText()); | | 6244 | + TEXT("ERROR: Could not write anchor file %s: %s"), | | 6245 | + wrapperData->anchorFilename, getLastErrorText()); | | 6189 | 6246 | appExit(1); | | 6190 | 6247 | return; /* For clarity. */ | | 6191 | 6248 | } | | 6192 | 6249 | } | | 6193 | 6250 | | | 6251 | + | | 6194 | 6252 | /* Prepare the service table */ | | 6195 | 6253 | serviceTable[0].lpServiceName = wrapperData->serviceName; | | 6196 | 6254 | serviceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)wrapperServiceMain; |
| | @@ -6292,10 +6350,15 @@ | | 6292 | 6350 | outClosed = TRUE; | | 6293 | 6351 | } | | 6294 | 6352 | /* currentBlockAvail is already in bytes! */ | | 6295 | | - if (ret && (currentBlockAvail > 0) && (currentBlockAvail < 512 * sizeof(TCHAR))) { | | 6353 | + if (ret && (currentBlockAvail > 0)) { | | 6354 | + if (currentBlockAvail < 512 * sizeof(TCHAR)) { | | 6355 | + writeOut = 512 * sizeof(TCHAR); | | 6356 | + } else { | | 6357 | + writeOut = currentBlockAvail; | | 6358 | + } | | 6296 | 6359 | /* Clean the buffer before each read, as we don't want old stuff */ | | 6297 | 6360 | memset(outbuf,0, sizeof(outbuf)); | | 6298 | | - if (ReadFile(out, outbuf, currentBlockAvail, &outRead, NULL) == TRUE) { | | 6361 | + if (ReadFile(out, outbuf, writeOut, &outRead, NULL) == TRUE) { | | 6299 | 6362 | /* if the message we just read in, doesn't have a new line, it means, that we most likely | | 6300 | 6363 | got the secondary process prompting sth. */ | | 6301 | 6364 | if (outbuf[_tcslen(outbuf) - 1] != TEXT('\n')) { |
| | @@ -187,6 +187,16 @@ | | 187 | 187 | return buildTM; | | 188 | 188 | } | | 189 | 189 | | | 190 | +int file_exists(const TCHAR * filename) { | | 191 | + FILE * file; | | 192 | + if ((file = _tfopen(filename, TEXT("r")))) { | | 193 | + fclose(file); | | 194 | + return TRUE; | | 195 | + } | | 196 | + return FALSE; | | 197 | +} | | 198 | + | | 199 | + | | 190 | 200 | struct tm wrapperGetReleaseTime() { | | 191 | 201 | return getInfoTime(wrapperReleaseDate, wrapperReleaseTime); | | 192 | 202 | } |
| | @@ -2170,6 +2180,7 @@ | | 2170 | 2180 | wrapperData->outputFilterCount = 0; | | 2171 | 2181 | wrapperData->confDir = NULL; | | 2172 | 2182 | wrapperData->umask = -1; | | 2183 | + wrapperData->language = NULL; | | 2173 | 2184 | #ifdef WIN32 | | 2174 | 2185 | if (!(tickMutexHandle = CreateMutex(NULL, FALSE, NULL))) { | | 2175 | 2186 | printf("Failed to create tick mutex. %s\n", getLastErrorText()); |
| | @@ -6015,7 +6026,7 @@ | | 6015 | 6026 | | | 6016 | 6027 | /* Allocate the correct amount of memory */ | | 6017 | 6028 | *stringsPtr = malloc((*length) * sizeof **stringsPtr ); | | 6018 | | - if (!stringsPtr) { | | 6029 | + if (!(*stringsPtr)) { | | 6019 | 6030 | outOfMemory(TEXT("WBJCA"), 1); | | 6020 | 6031 | return TRUE; | | 6021 | 6032 | } |
| | @@ -7149,6 +7160,12 @@ | | 7149 | 7160 | | | 7150 | 7161 | #endif | | 7151 | 7162 | | | 7163 | + if (_tcscmp(wrapperVersionRoot, getStringProperty(properties, TEXT("wrapper.script.version"), wrapperVersionRoot)) != 0) { | | 7164 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_WARN, | | 7165 | + TEXT("The version of the script (%s) doesn't match the version of this Wrapper (%s). This might cause some problems"), | | 7166 | + getStringProperty(properties, TEXT("wrapper.script.version"), wrapperVersionRoot), wrapperVersionRoot); | | 7167 | + } | | 7168 | + | | 7152 | 7169 | wrapperData->configured = TRUE; | | 7153 | 7170 | | | 7154 | 7171 | return FALSE; |
| | @@ -167,10 +167,17 @@ | | 167 | 167 | * filename: File to write to. | | 168 | 168 | * pid: pid to write in the file. | | 169 | 169 | */ | | 170 | | -int writePidFile(const TCHAR *filename, DWORD pid, int newUmask) { | | 170 | +int writePidFile(const TCHAR *filename, DWORD pid, int newUmask, int exclusive) { | | 171 | 171 | FILE *pid_fp = NULL; | | 172 | 172 | int old_umask; | | 173 | 173 | | | 174 | + if (getBooleanProperty(properties, TEXT("wrapper.pidfile.strict"), FALSE, FALSE) == TRUE && | | 175 | + exclusive == TRUE && file_exists(filename)) { | | 176 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_ERROR, | | 177 | + TEXT("%d pid file, %s, already exists."), pid, filename); | | 178 | + return 1; | | 179 | + } | | 180 | + | | 174 | 181 | old_umask = umask(newUmask); | | 175 | 182 | pid_fp = _tfopen(filename, TEXT("w")); | | 176 | 183 | umask(old_umask); |
| | @@ -1253,7 +1260,7 @@ | | 1253 | 1260 | | | 1254 | 1261 | /* If a java pid filename is specified then write the pid of the java process. */ | | 1255 | 1262 | if (wrapperData->javaPidFilename) { | | 1256 | | - if (writePidFile(wrapperData->javaPidFilename, wrapperData->javaPID, wrapperData->javaPidFileUmask)) { | | 1263 | + if (writePidFile(wrapperData->javaPidFilename, wrapperData->javaPID, wrapperData->javaPidFileUmask, FALSE)) { | | 1257 | 1264 | log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_WARN, | | 1258 | 1265 | TEXT("Unable to write the Java PID file: %s"), wrapperData->javaPidFilename); | | 1259 | 1266 | } |
| | @@ -1261,7 +1268,7 @@ | | 1261 | 1268 | | | 1262 | 1269 | /* If a java id filename is specified then write the pid of the java process. */ | | 1263 | 1270 | if (wrapperData->javaIdFilename) { | | 1264 | | - if (writePidFile(wrapperData->javaIdFilename, wrapperData->jvmRestarts, wrapperData->javaIdFileUmask)) { | | 1271 | + if (writePidFile(wrapperData->javaIdFilename, wrapperData->jvmRestarts, wrapperData->javaIdFileUmask, FALSE)) { | | 1265 | 1272 | log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_WARN, | | 1266 | 1273 | TEXT("Unable to write the Java Id file: %s"), wrapperData->javaIdFilename); | | 1267 | 1274 | } |
| | @@ -1825,10 +1832,32 @@ | | 1825 | 1832 | rollLogs(); | | 1826 | 1833 | } | | 1827 | 1834 | | | 1835 | + if (wrapperData->pidFilename) { | | 1836 | + if (writePidFile(wrapperData->pidFilename, wrapperData->wrapperPID, wrapperData->pidFileUmask, TRUE)) { | | 1837 | + log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 1838 | + TEXT("ERROR: Could not write pid file %s: %s"), | | 1839 | + wrapperData->pidFilename, getLastErrorText()); | | 1840 | + /* Common wrapper cleanup code. */ | | 1841 | + wrapperDispose(); | | 1842 | +#if defined(UNICODE) | | 1843 | + for (i = 0; i < argc; i++) { | | 1844 | + if (argv[i]) { | | 1845 | + free(argv[i]); | | 1846 | + } | | 1847 | + } | | 1848 | + if (argv) { | | 1849 | + free(argv); | | 1850 | + } | | 1851 | +#endif | | 1852 | + exit(1); | | 1853 | + return 1; /* For compiler. */ | | 1854 | + } | | 1855 | + } | | 1856 | + | | 1828 | 1857 | /* Write pid and anchor files as requested. If they are the same file the file is | | 1829 | 1858 | * simply overwritten. */ | | 1830 | 1859 | if (wrapperData->anchorFilename) { | | 1831 | | - if (writePidFile(wrapperData->anchorFilename, wrapperData->wrapperPID, wrapperData->anchorFileUmask)) { | | 1860 | + if (writePidFile(wrapperData->anchorFilename, wrapperData->wrapperPID, wrapperData->anchorFileUmask, FALSE)) { | | 1832 | 1861 | log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 1833 | 1862 | TEXT("ERROR: Could not write anchor file %s: %s"), | | 1834 | 1863 | wrapperData->anchorFilename, getLastErrorText()); |
| | @@ -1836,17 +1865,9 @@ | | 1836 | 1865 | return 1; /* For compiler. */ | | 1837 | 1866 | } | | 1838 | 1867 | } | | 1839 | | - if (wrapperData->pidFilename) { | | 1840 | | - if (writePidFile(wrapperData->pidFilename, wrapperData->wrapperPID, wrapperData->pidFileUmask)) { | | 1841 | | - log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_FATAL, | | 1842 | | - TEXT("ERROR: Could not write pid file %s: %s"), | | 1843 | | - wrapperData->pidFilename, getLastErrorText()); | | 1844 | | - appExit(1, argc, argv); | | 1845 | | - return 1; /* For compiler. */ | | 1846 | | - } | | 1847 | | - } | | 1868 | + | | 1848 | 1869 | if (wrapperData->lockFilename) { | | 1849 | | - if (writePidFile(wrapperData->lockFilename, wrapperData->wrapperPID, wrapperData->lockFileUmask)) { | | 1870 | + if (writePidFile(wrapperData->lockFilename, wrapperData->wrapperPID, wrapperData->lockFileUmask, FALSE)) { | | 1850 | 1871 | /* This will fail if the user is running as a user without full privileges. | | 1851 | 1872 | * To make things easier for user configuration, this is ignored if sufficient | | 1852 | 1873 | * privileges do not exist. */ |
| | @@ -957,4 +957,6 @@ | | 957 | 957 | extern void wrapperStoppedSignaled(); | | 958 | 958 | extern void wrapperStartPendingSignaled(int waitHint); | | 959 | 959 | extern void wrapperStartedSignaled(); | | 960 | +extern int file_exists(const TCHAR * filename); | | 961 | + | | 960 | 962 | #endif |
| | @@ -429,7 +429,7 @@ | | 429 | 429 | free(workLogFileName); | | 430 | 430 | workLogFileName = NULL; | | 431 | 431 | } | | 432 | | - if (loginfoSourceName != defaultLoginfoSourceName) { | | 432 | + if (loginfoSourceName != defaultLoginfoSourceName && loginfoSourceName != NULL) { | | 433 | 433 | free(loginfoSourceName); | | 434 | 434 | loginfoSourceName = NULL; | | 435 | 435 | } |
| | @@ -1137,7 +1137,9 @@ | | 1137 | 1137 | size_t size; | | 1138 | 1138 | if (event_source_name != NULL) { | | 1139 | 1139 | if (loginfoSourceName != defaultLoginfoSourceName) { | | 1140 | | - free(loginfoSourceName); | | 1140 | + if (loginfoSourceName != NULL) { | | 1141 | + free(loginfoSourceName); | | 1142 | + } | | 1141 | 1143 | } | | 1142 | 1144 | #ifdef WIN32 | | 1143 | 1145 | size = sizeof(TCHAR) * (_tcslen(event_source_name) + 1); |
| | @@ -1151,7 +1153,7 @@ | | 1151 | 1153 | return; | | 1152 | 1154 | } | | 1153 | 1155 | #ifdef WIN32 | | 1154 | | - _tcsncpy(loginfoSourceName, event_source_name, _tcslen(event_source_name)); | | 1156 | + _tcsncpy(loginfoSourceName, event_source_name, _tcslen(event_source_name) + 1); | | 1155 | 1157 | if (_tcslen(loginfoSourceName) > 32) { | | 1156 | 1158 | loginfoSourceName[32] = TEXT('\0'); | | 1157 | 1159 | } |
| | @@ -1781,6 +1781,9 @@ | | 1781 | 1781 | setInnerProperty(property, propertyValueTrim); | | 1782 | 1782 | } | | 1783 | 1783 | | | 1784 | + if (property->value == NULL) { | | 1785 | + return NULL; | | 1786 | + } | | 1784 | 1787 | /* Store the final flag */ | | 1785 | 1788 | property->finalValue = finalValue; | | 1786 | 1789 | |
| | @@ -28,7 +28,7 @@ | | 28 | 28 | TCHAR *wrapperBits = TEXT("@bits@"); | | 29 | 29 | TCHAR *wrapperArch = TEXT("@dist.arch@"); | | 30 | 30 | TCHAR *wrapperOS = TEXT("@dist.os@"); | | 31 | | -TCHAR *wrapperReleaseDate = TEXT("20111201"); | | 31 | +TCHAR *wrapperReleaseDate = TEXT("20120209"); | | 32 | 32 | TCHAR *wrapperReleaseTime = TEXT("0000"); | | 33 | 33 | TCHAR *wrapperBuildDate = TEXT("@build.date@"); | | 34 | 34 | TCHAR *wrapperBuildTime = TEXT("@build.time@"); |
| | @@ -117,6 +117,9 @@ | | 117 | 117 | # Allow for the use of non-contiguous numbered properties | | 118 | 118 | wrapper.ignore_sequence_gaps=TRUE | | 119 | 119 | | | 120 | +# Do not start if the pid file already exists. | | 121 | +wrapper.pidfile.strict=TRUE | | 122 | + | | 120 | 123 | # Title to use when running as a console | | 121 | 124 | wrapper.console.title=@app.long.name@ | | 122 | 125 | |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | #----------------------------------------------------------------------------- | | 18 | 18 | # These settings can be modified to fit the needs of your application | | 19 | | -# Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +# Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | # Application | | 22 | 22 | APP_NAME="@app.name@" |
| | @@ -757,7 +757,7 @@ | | 757 | 757 | prepAdditionalParams "$@" | | 758 | 758 | | | 759 | 759 | # The string passed to eval must handles spaces in paths correctly. | | 760 | | - COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $ADDITIONAL_PARA" | | 760 | + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.14 $ADDITIONAL_PARA" | | 761 | 761 | eval $COMMAND_LINE | | 762 | 762 | else | | 763 | 763 | eval echo `gettext '$APP_LONG_NAME is already running.'` |
| | @@ -780,7 +780,7 @@ | | 780 | 780 | prepAdditionalParams "$@" | | 781 | 781 | | | 782 | 782 | # The string passed to eval must handles spaces in paths correctly. | | 783 | | - COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP $ADDITIONAL_PARA" | | 783 | + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.14 $ADDITIONAL_PARA" | | 784 | 784 | eval $COMMAND_LINE | | 785 | 785 | else | | 786 | 786 | eval echo `gettext '$APP_LONG_NAME is already running.'` |
| | @@ -902,7 +902,7 @@ | | 902 | 902 | prepAdditionalParams "$@" | | 903 | 903 | | | 904 | 904 | # The string passed to eval must handles spaces in paths correctly. | | 905 | | - COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $ADDITIONAL_PARA" | | 905 | + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.14 $ADDITIONAL_PARA" | | 906 | 906 | eval $COMMAND_LINE | | 907 | 907 | else | | 908 | 908 | eval echo `gettext '$APP_LONG_NAME is already running.'` |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -63,16 +63,16 @@ | | 63 | 63 | :search | | 64 | 64 | | | 65 | 65 | set _WRAPPER_EXE=%_WRAPPER_L_EXE% | | 66 | | -if not exist "%_WRAPPER_EXE%" ( | | 67 | | - set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe | | 68 | | -) else if not exist "%_WRAPPER_EXE%" ( | | 69 | | - echo Unable to locate a Wrapper executable using any of the following names: | | 70 | | - echo %_WRAPPER_L_EXE% | | 71 | | - echo %_WRAPPER_EXE% | | 72 | | - pause | | 73 | | - goto :eof | | 74 | | -) | | 66 | +if exist "%_WRAPPER_EXE%" goto conf | | 67 | +set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe | | 68 | +if exist "%_WRAPPER_EXE%" goto conf | | 69 | +echo Unable to locate a Wrapper executable using any of the following names: | | 70 | +echo %_WRAPPER_L_EXE% | | 71 | +echo %_WRAPPER_EXE% | | 72 | +pause | | 73 | +goto :eof | | 75 | 74 | | | 75 | +:conf | | 76 | 76 | if not [%_FIXED_COMMAND%]==[] ( | | 77 | 77 | set _COMMAND=%_FIXED_COMMAND% | | 78 | 78 | ) else ( |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -16,7 +16,7 @@ | | 16 | 16 | | | 17 | 17 | rem ----------------------------------------------------------------------------- | | 18 | 18 | rem These settings can be modified to fit the needs of your application | | 19 | | -rem Optimized for use with version 3.5.14-a of the Wrapper. | | 19 | +rem Optimized for use with version 3.5.14 of the Wrapper. | | 20 | 20 | | | 21 | 21 | rem The base name for the Wrapper binary. | | 22 | 22 | set _WRAPPER_BASE=wrapper |
| | @@ -1,5 +1,5 @@ | | 1 | 1 | ----------------------------------------------------------------------------- | | 2 | | -Java Service Wrapper Community Edition 3.5.14-a | | 2 | +Java Service Wrapper Community Edition 3.5.14 | | 3 | 3 | Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved. | | 4 | 4 | http://wrapper.tanukisoftware.com | | 5 | 5 | ----------------------------------------------------------------------------- |
旧リポジトリブラウザで表示
|