com.ibm.jsdt.support
Class SupportLinuxHelper

java.lang.Object
  extended by com.ibm.jsdt.support.SupportHelper
      extended by com.ibm.jsdt.support.SupportLinuxHelper

Deprecated. Due to new package com.ibm.jsdt.support.deploymenthelper

public class SupportLinuxHelper
extends SupportHelper

Linux specific helper functionality.


Field Summary
static java.lang.String sNEWLN
          Deprecated.  
 
Fields inherited from class com.ibm.jsdt.support.SupportHelper
theSupportBase
 
Constructor Summary
SupportLinuxHelper()
          Deprecated. Sole constructor.
 
Method Summary
 boolean addGroup(SupportBase s)
          Deprecated. Creates a new user ID group.
 boolean addLinuxUser(SupportBase s)
          Deprecated. Creates a new user ID using the Linux system's native password hashing/encryption algorithim and creates the /home/ directory.
 boolean addUser(SupportBase s)
          Deprecated. Creates a new user ID.
 boolean addUserToGroup(SupportBase s)
          Deprecated. Adds a user to a group.
 void chmodDirPermissions(SupportBase s)
          Deprecated. Changes the permissions on a folder.
 void chmodFilePermissions(SupportBase s)
          Deprecated. Changes the permissions on a file.
 boolean doesGroupExist(SupportBase s)
          Deprecated. Verifies the existence of a user group.
 boolean doesUserExist(SupportBase s)
          Deprecated. Verifies the existence of a user ID.
 int doUserAdd(SupportBase s)
          Deprecated. Adds a user to the Linux system by using the useradd command.
 java.lang.String getDeviceNameFromMountPoint(SupportBase s)
          Deprecated. Gets the device name, given a mount point on Linux.
 int invokeCommandAsUserLogOutput(java.lang.String command, java.lang.String commandToLog, java.lang.String userID)
          Deprecated. Builds the appropriate command string and calls super invokeCommandLogOutput(), which logs the commandToLog string, processes the command that the user specified, and waits for it to finish.
 int isAllRPMsInstalled(SupportBase s)
          Deprecated. Inclusively checks for a set of RPMs.
 int isAnyRPMsInstalled(SupportBase s)
          Deprecated. Noninclusively checks for a set of RPMs.
 boolean isIntelBasedLinux(SupportBase s)
          Deprecated. Indicates whether the current architecture is Intel-based Linux.
 boolean isPowerLinux(SupportBase s)
          Deprecated. Indicates whether the current architecture is Linux on POWER.
 boolean isRHEL4()
          Deprecated. Determine if the target computer is running Red Hat Enterprise Linux release 4.
 boolean isRHEL5()
          Deprecated. Determine if target system is Red Hat Enterprise Linux release 5.
 boolean isRootUser()
          Deprecated. Returns true if the current user is a root user.
 boolean isRpmInstalled(SupportBase s)
          Deprecated. Checks to see if a specific RPM package is installed.
 boolean isSLES10()
          Deprecated. Check if target system is SUSE Linux Enterprise Server 10 return true if the current version of Linux is SLES 9, else returns false.
 boolean isSLES9()
          Deprecated. Check if target system is SUSE Linux Enterprise Server 9 return true if the current version of Linux is SLES 9, else returns false.
 boolean isUserAndPasswordValid(SupportBase s)
          Deprecated. Verifies if the given user and password are valid.
 
Methods inherited from class com.ibm.jsdt.support.SupportHelper
arraySearch, buildCommand, checkDeployerVersion, checkFreeSpace, checkFreeSpaceAvailable, checkTargetDir, checkTargetDirectory, compareVersions, copyDirectory, determineLogFileName, directoryGrep, endOfFileGrep, executeCommand, fileCopy, fileCopyAndRename, fileDelete, fileExists, fileGrep, fileGrep, fileLength, fileSearchAndReplace, fileSearchAndReplaceLine, fileSearchAndReturnLinesWithSearch, findAndReplace, getBackLevelLogFileName, getCommandStdError, getCommandStdOut, getDeployerLocale, getDomain, getEntryResponseFilePath, getExitResponseFilePath, getFileValue, getGroupLocale, getHostName, getIbmNsiISMPPropValue, getIbmNsiProperties, getIbmNsiPropValue, getIbmNsiPropValue, getIbmNsiPropValueByKey, getLastCommandOutput, getLastCommandReturnCode, getLogsDir, getMainResponseFilePath, getOSType, getPartitionCapacity, getPartitionFileSystemType, getPartitionVolumeLabel, getPasswordValue, getPasswordValueByKey, getPreDeploymentCheckerResponseFilePath, getProductInstallingBundleProperties, getProductInstallingId, getProductInstallingVersion, getQualifiedHostName, getQualifiedHostName, getQualifiedTiedPasswordValue, getQualifiedTiedVariableValue, getResponseFilePath, getResponseFilePath, getResponseFilePaths, getResponseFileProperties, getResponseFileProperty, getResponseFileValue, getSelectedTaskList, getSetupFileRemovalSetting, getStringFromCommandArray, getSystemCommandOutput, getSystemCommandOutput, getSystemEnvVar, getTaskApplicationList, getTaskHostnameList, getTempDir, getTheSupportBase, getTiedPasswordValue, getTiedPasswordValueForKey, getTiedVariableValue, getTiedVariableValueForKey, getTranslatedMessage, getUnpackedDir, getVariableValueForTaskApplication, getVpdInstallLocationArray, getVpdPropertyList, getVpdVersionArray, invokeCommand, invokeCommand, invokeCommand, invokeCommandLogOutput, invokeCommandLogOutput, invokeCommandLogOutput, invokeCommandLogOutputToFileName, invokeCommandLogOutputToFileName, invokeCommandLogOutputToFileName, isAix, isAixOSType, isApplicationVersionEqual, isEnoughTargetDirSpace, isEnoughTargetDirSpaceAvailable, isHPUX, isHPUXOSType, isIpv6Address, isLinux, isLinuxOSType, isLinuxX86_32, isLinuxX86_64, isOS400, isOS400OSType, isPortOpen, isPortRegistered, isPowerLinuxOSType, isSameDirectoryName, isSunOS, isSunOSType, isVersionSupported, isWindows, isWindowsOSType, launchAndWait, launchLocalInteractiveProgram, log, log, log, logAppendFile, logAppendFile, logAppendFile, logAppendFile, logAppendFile, logNewLine, logStatus, modifyResponseFile, postCompletionMessageToDeployerUI, postErrorMessageToDeployerMainUI, postErrorMessageToDeployerUI, postInformationMessageToDeployerMainUI, postInformationMessageToDeployerUI, postSuccessMessageToDeployerMainUI, postSuccessMessageToDeployerUI, postWarningMessageToDeployerMainUI, postWarningMessageToDeployerUI, readFile, removeAlphaCharsFromString, replaceSubstring, setFileValue, setIbmNsiProperty, setResponseFileProperty, setResponseFileValue, setResponseFileValue, setTheSupportBase, trimDoubleQuotes, unPackJar, valueExists, waitForFile, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sNEWLN

public static final java.lang.String sNEWLN
Deprecated. 
Constructor Detail

SupportLinuxHelper

public SupportLinuxHelper()
Deprecated. 
Sole constructor.

Method Detail

doesUserExist

public boolean doesUserExist(SupportBase s)
Deprecated. 
Verifies the existence of a user ID.

The SupportBase to be queried must call SupportBase.setUserName before calling this method.

Parameters:
s - the SupportBase to be queried
  • a user name SupportBase.getUserName
Returns:
a boolean
  • true if found
  • false all else

addUser

public boolean addUser(SupportBase s)
Deprecated. 
Creates a new user ID.

The SupportBase to be queried must call SupportBase.setUserName, SupportBase.setPassword, and SupportBase.setGroupName before calling this method.

Parameters:
s - the SupportBase to be queried
  • a user name SupportBase.getUserName
  • a password SupportBase.getPassword
  • a group name SupportBase.getGroupName
Returns:
a boolean
  • true if successfully created
  • false all else

addLinuxUser

public boolean addLinuxUser(SupportBase s)
Deprecated. 
Creates a new user ID using the Linux system's native password hashing/encryption algorithim and creates the /home/ directory.

The SupportBase to be queried must call SupportBase.setUserName, SupportBase.setPassword, and

Parameters:
s - the SupportBase to be queried
  • a user name SupportBase.getUserName
  • a password SupportBase.getPassword
    Returns:
    a boolean
    • true if successfully created
    • false all else

doesGroupExist

public boolean doesGroupExist(SupportBase s)
Deprecated. 
Verifies the existence of a user group.

The SupportBase to be queried must call SupportBase.setGroupName before calling this method.

Parameters:
s - the SupportBase to be queried
  • a group name SupportBase.getGroupName
Returns:
a boolean
  • true if found
  • false all else

addGroup

public boolean addGroup(SupportBase s)
Deprecated. 
Creates a new user ID group.

The SupportBase to be queried must call SupportBase.setGroupName before calling this method.

Parameters:
s - the SupportBase to be queried
  • a String Linux group name SupportBase.getGroupName
Returns:
a boolean
  • true if found
  • false all else

addUserToGroup

public boolean addUserToGroup(SupportBase s)
Deprecated. 
Adds a user to a group.

The SupportBase to be queried must call SupportBase.setUserName and SupportBase.setGroupName before calling this method.

Parameters:
s - the SupportBase to be queried
  • a String Linux group name SupportBase.getGroupName
  • a String user name SupportBase.getUsername
Returns:
a boolean
  • true if found
  • false all else

isAllRPMsInstalled

public int isAllRPMsInstalled(SupportBase s)
Deprecated. 
Inclusively checks for a set of RPMs.

Do not use suffixes on the RPM name, such as ".i386.rpm". For example, the RPM file db2rte71-7.1.0-0.i386.rpm would have the following valid names:
  db2rte71 and db2rte71-7.1.0-0
And the following names would not be valid:
  db2rte71-7.1.0-0.i386 and db2rte71-7.1.0-0.i386.rpm

The SupportBase to be queried must call SupportBase.setRPMArray before calling this method.

Parameters:
s - the SupportBase to be queried
  • an Objects[] array of RPM package names SupportBase.getRPMArray
Returns:
an int
  • 0 if all RPMs are found to be installed
  • 1 if less than all RPMs are installed or bad RPM names
  • 99 exception

isAnyRPMsInstalled

public int isAnyRPMsInstalled(SupportBase s)
Deprecated. 
Noninclusively checks for a set of RPMs.

Do not use suffixes on the RPM name, such as ".i386.rpm". For example, the RPM file db2rte71-7.1.0-0.i386.rpm would have the following valid names:
  db2rte71 and db2rte71-7.1.0-0
And the following names would not be valid:
  db2rte71-7.1.0-0.i386 and db2rte71-7.1.0-0.i386.rpm

The SupportBase to be queried must call SupportBase.setRPMArray before calling this method.

Parameters:
s - the SupportBase to be queried
  • an array of RPM package names SupportBase.getRPMArray
    Returns:
    an int
    • 0 if none are found
    • n+1 the number in the array of the RPM that was found

isRpmInstalled

public boolean isRpmInstalled(SupportBase s)
Deprecated. 
Checks to see if a specific RPM package is installed.

The SupportBase to be queried must call SupportBase.setRPMPackage before calling this method.

Parameters:
s - the SupportBase to be queried
  • a String of an RPM package name SupportBase.getRpmPackage
Returns:
a boolean
  • true if it is installed
  • false otherwise

chmodDirPermissions

public void chmodDirPermissions(SupportBase s)
Deprecated. 
Changes the permissions on a folder.

The SupportBase to be queried must call SupportBase.setPath and SupportBase.setChmodValue before calling this method.

Parameters:
s - the SupportBase to be queried
  • a String path SupportBase.getPath
  • a String valid chmod argument SupportBase.getChmodValue

chmodFilePermissions

public void chmodFilePermissions(SupportBase s)
Deprecated. 
Changes the permissions on a file.

The SupportBase to be queried must call SupportBase.setFileName and SupportBase.setChmodValue before calling this method.

Parameters:
s - the SupportBase to be queried
  • a String file name SupportBase.getFileName
  • a String valid chmod argument SupportBase.getChmodValue

isRootUser

public boolean isRootUser()
Deprecated. 
Returns true if the current user is a root user. Returns false if the current user is not a root user, or if an error occurred while detecting the current user level.


isUserAndPasswordValid

public boolean isUserAndPasswordValid(SupportBase s)
Deprecated. 
Verifies if the given user and password are valid.

This will not work with releases prior to IR 2.1.0.0 and IIA "agent version" prior to 3.1.0.0 . A value of true is returned when run on a back level IIA.

The SupportBase to be queried must call SupportBase.setUserName and SupportBase.setPassword before calling this method. This method works for shadow passwords and the older, less secure UNIX password storage mechanism. Note: If the target machine uses DES password encryption, it is possible that a password match could occur even if the passwords do not completely match. This is a limitation of DES encryption. DES only matches the first 8 characters. If the root password is "passw0rd", "passw0rd1" will be accepted because the first 8 characters match. A machine with DES password encryption would accept "password1" as a valid root password.

Parameters:
s - the SupportBase to be queried
  • a user name SupportBase.getUserName
  • a password SupportBase.getPassword
Returns:
a boolean
  • true if found
  • false all else

isIntelBasedLinux

public boolean isIntelBasedLinux(SupportBase s)
Deprecated. 
Indicates whether the current architecture is Intel-based Linux.

Parameters:
s - the SupportBase to be queried
    Returns:
    boolean

isPowerLinux

public boolean isPowerLinux(SupportBase s)
Deprecated. 
Indicates whether the current architecture is Linux on POWER.

Parameters:
s - the SupportBase to be queried
    Returns:
    boolean

doUserAdd

public int doUserAdd(SupportBase s)
Deprecated. 
Adds a user to the Linux system by using the useradd command.

Example command: useradd -m -d /home/db2inst2 -p encPwd db2inst2

The SupportBase to be queried must invoke SupportBase.setUserName and SupportBase.setPassword .

This method can only be called with local deployments or on remote computers running IBM Installation Agents with a specification version of 2.1.1.0 or later. If a down-level agent is encountered, a value of Integer.MIN_VALUE (-2147483648) is returned.

Returns:
int the return code from the useradd call.

getDeviceNameFromMountPoint

public java.lang.String getDeviceNameFromMountPoint(SupportBase s)
Deprecated. 
Gets the device name, given a mount point on Linux. The SupportBase to be queried must call SupportBase.setPath before calling this method.

Type Parameters:
code - SupportBase
Returns:
String

isRHEL4

public boolean isRHEL4()
Deprecated. 
Determine if the target computer is running Red Hat Enterprise Linux release 4. Returns true if the current version of Linux is Red Hat release 4; else returns false.

Returns:
boolean

isSLES9

public boolean isSLES9()
Deprecated. 
Check if target system is SUSE Linux Enterprise Server 9 return true if the current version of Linux is SLES 9, else returns false.

Returns:
boolean

isSLES10

public boolean isSLES10()
Deprecated. 
Check if target system is SUSE Linux Enterprise Server 10 return true if the current version of Linux is SLES 9, else returns false.

Returns:
boolean

invokeCommandAsUserLogOutput

public int invokeCommandAsUserLogOutput(java.lang.String command,
                                        java.lang.String commandToLog,
                                        java.lang.String userID)
Deprecated. 
Builds the appropriate command string and calls super invokeCommandLogOutput(), which logs the commandToLog string, processes the command that the user specified, and waits for it to finish. The return code from the command and the command output are logged. The command return code is returned to the caller.

The string “su - “ is added to the beginning of the command.

All output is logged to the default log file specified in the application wrapper or the SupportBase.log.

Parameters:
command - - The command string to run.
commandToLog - - The command string to write to the deployment wizard log.
Returns:
The return code from the command.

isRHEL5

public boolean isRHEL5()
Deprecated. 
Determine if target system is Red Hat Enterprise Linux release 5.

Returns:
true if system is RHEL 5 server or advanced platform false otherwise