Fixed problem with NFS server trying to start when there is no configuration section. Added <disableNFS>, <disableFTP> and

<disableCIFS> tags to allow servers to be switched off easily. Added NFS configuration section to disable server.
Fix for AR-1156.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4759 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2007-01-09 09:53:00 +00:00
parent 6c74208342
commit 13e6f22641
2 changed files with 13 additions and 7 deletions

View File

@@ -29,6 +29,10 @@
<!-- <debug flags="File,Search,Error,Directory,Info,DataPort"/> --> <!-- <debug flags="File,Search,Error,Directory,Info,DataPort"/> -->
</config> </config>
<config evaluator="string-compare" condition="NFS Server">
<disableNFS/>
</config>
<config evaluator="string-compare" condition="Filesystems"> <config evaluator="string-compare" condition="Filesystems">
<filesystems> <filesystems>
<filesystem name="Alfresco"> <filesystem name="Alfresco">

View File

@@ -579,6 +579,7 @@ public class ServerConfiguration extends AbstractLifecycleBean
// Create the configuration context // Create the configuration context
ConfigLookupContext configCtx = new ConfigLookupContext(ConfigArea); ConfigLookupContext configCtx = new ConfigLookupContext(ConfigArea);
configCtx.setIncludeGlobalSection( false);
// Set the platform type // Set the platform type
@@ -684,7 +685,7 @@ public class ServerConfiguration extends AbstractLifecycleBean
try try
{ {
// Process the NFS server configuration // Process the NFS server configuration
config = configService.getConfig(ConfigNFS, configCtx); config = configService.getConfig(ConfigNFS, configCtx);
processNFSServerConfig(config); processNFSServerConfig(config);
@@ -696,7 +697,7 @@ public class ServerConfiguration extends AbstractLifecycleBean
{ {
// Configuration error // Configuration error
logger.error("FTP server configuration error, " + ex.getMessage(), ex); logger.error("NFS server configuration error, " + ex.getMessage(), ex);
} }
} }
else else
@@ -745,7 +746,8 @@ public class ServerConfiguration extends AbstractLifecycleBean
{ {
// If the configuration section is not valid then CIFS is disabled // If the configuration section is not valid then CIFS is disabled
if ( config == null || config.getConfigElements().isEmpty()) if ( config == null || config.getConfigElements().isEmpty() ||
config.getConfigElement( "disableCIFS") != null)
{ {
setSMBServerEnabled(false); setSMBServerEnabled(false);
return; return;
@@ -1512,7 +1514,7 @@ public class ServerConfiguration extends AbstractLifecycleBean
{ {
// If the configuration section is not valid then FTP is disabled // If the configuration section is not valid then FTP is disabled
if ( config == null) if ( config == null || config.getConfigElement( "disableFTP") != null)
{ {
setFTPServerEnabled(false); setFTPServerEnabled(false);
return; return;
@@ -1702,7 +1704,7 @@ public class ServerConfiguration extends AbstractLifecycleBean
{ {
// If the configuration section is not valid then NFS is disabled // If the configuration section is not valid then NFS is disabled
if ( config == null) if ( config == null || config.getConfigElement( "disableNFS") != null)
{ {
setNFSServerEnabled(false); setNFSServerEnabled(false);
return; return;
@@ -2199,8 +2201,8 @@ public class ServerConfiguration extends AbstractLifecycleBean
{ {
// Check if the appropriate authentication component type is configured // Check if the appropriate authentication component type is configured
// if ( ntlmMode != NTLMMode.NONE) if ( ntlmMode != NTLMMode.NONE)
// throw new AlfrescoRuntimeException("Wrong authentication setup for passthru authenticator (can only be used with LDAP/JAAS auth component)"); throw new AlfrescoRuntimeException("Wrong authentication setup for passthru authenticator (can only be used with LDAP/JAAS auth component)");
// Load the passthru authenticator dynamically // Load the passthru authenticator dynamically