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 20 Dec 2006 08:43:58 -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/SMFServiceHandler.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 20 Dec 2006 08:43:58 -0000 *************** *** 85,91 **** } } ! private void testPlatform() throws Exception { if (!OS.isSolaris10()) { final String os = System.getProperty("os.name"); final String vr = System.getProperty("os.version"); --- 85,91 ---- } } ! public void testPlatform() throws Exception { if (!OS.isSolaris10()) { final String os = System.getProperty("os.name"); final String vr = System.getProperty("os.version"); Index: appserv-commons/src/java/com/sun/enterprise/util/OS.java =================================================================== RCS file: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/util/OS.java,v retrieving revision 1.5 diff -c -r1.5 OS.java *** appserv-commons/src/java/com/sun/enterprise/util/OS.java 25 Dec 2005 04:12:02 -0000 1.5 --- appserv-commons/src/java/com/sun/enterprise/util/OS.java 20 Dec 2006 08:44:08 -0000 *************** *** 97,102 **** --- 97,172 ---- { return isName("linux"); } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isDebianLinux() + { + return isLinux() && new File("/etc/debian_version").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isFedoraLinux() + { + return isLinux() && new File("/etc/fedora-release").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isGentooLinux() + { + return isLinux() && new File("/etc/gentoo-release").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isKnoppixLinux() + { + return isLinux() && new File("/etc/knoppix_version").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isMandrakeLinux() + { + return isLinux() && new File("/etc/mandrake-release").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isMandrivaLinux() + { + return isLinux() && new File("/etc/mandriva-release").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isRedHatLinux() + { + return isLinux() && new File("/etc/redhat-release").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isSlackwareLinux() + { + return isLinux() && new File("/etc/slackware-version").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isSuSELinux() + { + return isLinux() && new File("/etc/SuSE-release").exists(); + } + + /////////////////////////////////////////////////////////////////////////// + + public static boolean isUbuntuLinux() + { + return isLinux() && new File("/etc/lsb-release").exists(); + } /////////////////////////////////////////////////////////////////////////// *************** *** 182,187 **** --- 252,267 ---- System.out.println("isWindowsForSure() returned: " + isWindowsForSure()); System.out.println("isSun() returned: " + isSun()); System.out.println("isLinux() returned: " + isLinux()); + System.out.println("isDebianLinux() returned: " + isDebianLinux()); + System.out.println("isFedoraLinux() returned: " + isFedoraLinux()); + System.out.println("isGentooLinux() returned: " + isGentooLinux()); + System.out.println("isKnoppixLinux() returned: " + isKnoppixLinux()); + System.out.println("isMandrakeLinux() returned: " + isMandrakeLinux()); + System.out.println("isMandrivaLinux() returned: " + isMandrivaLinux()); + System.out.println("isRedHatLinux() returned: " + isRedHatLinux()); + System.out.println("isSlackwareLinux() returned: " + isSlackwareLinux()); + System.out.println("isSuSELinux() returned: " + isSuSELinux()); + System.out.println("isUbuntuLinux() returned: " + isUbuntuLinux()); System.out.println("isSunX86() returned: " + isSunX86()); System.out.println("isSunSparc() returned: " + isSunSparc()); System.out.println("isDarwin() returned: " + isDarwin());