Index: admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/LocalStrings.properties =================================================================== RCS file: /cvs/glassfish/admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/LocalStrings.properties,v retrieving revision 1.12 diff -c -r1.12 LocalStrings.properties *** admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/LocalStrings.properties 9 Oct 2006 18:03:33 -0000 1.12 --- admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/LocalStrings.properties 18 Dec 2006 15:17:51 -0000 *************** *** 40,46 **** doesNotExist=The object [{0}] could not be found. serviceTypeNotSet=Service type is not configured correctly. serviceTemplateNotFound=Service template [{0}] does not exist, something wrong with setting environment like INSTALL_ROOT etc. ! notSolaris10=Present Platform, OS: {0} version: {1} is not Solaris 10. This facility is not supported on platforms other than Solaris 10. noPermissionToCreateManifest=The user [{0}] does not have permission to create the service manifest related files and directories at [{1}]. This structure is required per SMF guidelines. Either become super-user to do this operation or contact the System Administrator to explicitly get the relevant permissions and try again. noSmfAuth=The user [{0}] does not seem to have adequate authorizations [solaris.smf.*] on this System to create and configure an SMF service. The authorizations available are [{1}].\nSee smf_security(5), rbac(5).\n missingParamsInFile=The passwordfile that was specified as [{0}] does not contain the property [{1}] in required form. Rerun the command after adding [{1}=value] to this file on a separate line. --- 40,47 ---- doesNotExist=The object [{0}] could not be found. serviceTypeNotSet=Service type is not configured correctly. serviceTemplateNotFound=Service template [{0}] does not exist, something wrong with setting environment like INSTALL_ROOT etc. ! notSolaris10=Present Platform, OS: {0} version: {1} is not Solaris 10 or Linux. This facility is not supported on platforms other than Solaris 10 and Linux. ! notLinux=Present Platform, OS: {0} version: {1} is not Linux. This facility is not supported on platforms other than Solaris 10 and Linux. noPermissionToCreateManifest=The user [{0}] does not have permission to create the service manifest related files and directories at [{1}]. This structure is required per SMF guidelines. Either become super-user to do this operation or contact the System Administrator to explicitly get the relevant permissions and try again. noSmfAuth=The user [{0}] does not seem to have adequate authorizations [solaris.smf.*] on this System to create and configure an SMF service. The authorizations available are [{1}].\nSee smf_security(5), rbac(5).\n missingParamsInFile=The passwordfile that was specified as [{0}] does not contain the property [{1}] in required form. Rerun the command after adding [{1}=value] to this file on a separate line. Index: admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/SMFService.java =================================================================== RCS file: /cvs/glassfish/admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/SMFServiceHandler.java,v retrieving revision 1.6 diff -c -r1.6 SMFServiceHandler.java *** admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/SMFServiceHandler.java 25 Dec 2005 03:44:05 -0000 1.6 --- admin/servermgmt/src/java/com/sun/enterprise/admin/servermgmt/SMFServiceHandler.java 18 Dec 2006 15:17:52 -0000 *************** *** 24,35 **** --- 24,37 ---- package com.sun.enterprise.admin.servermgmt; import com.sun.enterprise.util.i18n.StringManager; import com.sun.enterprise.admin.util.LineTokenReplacer; import com.sun.enterprise.admin.util.TokenValue; import com.sun.enterprise.admin.util.TokenValueSet; import com.sun.enterprise.util.OS; import com.sun.enterprise.util.ProcessExecutor; import java.io.File; import java.util.HashSet; import java.util.Map; import java.util.Set; *************** *** 85,96 **** } } ! private void testPlatform() throws Exception { ! if (!OS.isSolaris10()) { final String os = System.getProperty("os.name"); final String vr = System.getProperty("os.version"); final String msg = sm.getString("notSolaris10", os, vr); throw new IllegalArgumentException(msg); } } private void validateManifest(final String manifestPath) throws Exception { --- 87,103 ---- } } ! public void testPlatform() throws Exception { ! if (!OS.isSolaris10() && !OS.isLinux()) { final String os = System.getProperty("os.name"); final String vr = System.getProperty("os.version"); final String msg = sm.getString("notSolaris10", os, vr); throw new IllegalArgumentException(msg); + } else if (!OS.isLinux()) { + final String os = System.getProperty("os.name"); + final String vr = System.getProperty("os.version"); + final String msg = sm.getString("notLinux", os, vr); + throw new IllegalArgumentException(msg); } } private void validateManifest(final String manifestPath) throws Exception { *************** =================================================================== RCS file: /cvs/glassfish/admin-cli/commands/src/java/com/sun/enterprise/cli/commands/CreateServiceCommand.java,v retrieving revision 1.7 diff -c -r1.7 CreateServiceCommand.java *** admin-cli/commands/src/java/com/sun/enterprise/cli/commands/CreateServiceCommand.java 25 Dec 2005 03:46:23 -0000 1.7 --- admin-cli/commands/src/java/com/sun/enterprise/cli/commands/CreateServiceCommand.java 18 Dec 2006 15:17:53 -0000 *************** *** 31,36 **** --- 31,37 ---- import com.sun.enterprise.admin.servermgmt.RepositoryException; import com.sun.enterprise.admin.servermgmt.DomainsManager; import com.sun.enterprise.admin.servermgmt.DomainConfig; import java.io.File; import java.util.Date; *************** *** 122,127 **** --- 123,133 ---- String typeDir = (String) getOperands().get(0); final SMFServiceHandler sh = new SMFServiceHandler(); final SMFService service = new SMFService(); + try { + sh.testPlatform(); + } catch (Exception e) { + throw new CommandException(e.getMessage()); + } //configure service service.setDate(new Date().toString()); final StringBuilder ap = new StringBuilder(); ***************