未验证 提交 52c37372 编写于 作者: B Ben Christel 提交者: GitHub

Remove references to SunOS and HP-UX (#7356)

We don't support Greenplum on these platforms.

Some files (e.g. Makefile.{hpux,solaris}) have been left in place
because they are upstream postgres files. Removing them isn't
worth the headache it would cause when merging commits from
postgres.
Authored-by: NBen Christel <bchristel@pivotal.io>
上级 bfe58dc0
......@@ -17,11 +17,11 @@ You will need the following tools:
flex 2.5.4a or later. flex 2.5.35 preferred.
gcc 4.4.2
gfortran 4.4.2
greptools 2.5.1 on Linux, 2.5 on Solaris
greptools 2.5.1
libtool 1.4.6 on CentOS, 1.5.22 on SuSE
make 3.80 or later
perl 5.8.8
tar (GNU) 1.14 (named or symlinked to gtar on Solaris)
tar (GNU) 1.14
To build the Greenplum Database, run GNU make with the following options:
......
......@@ -226,7 +226,6 @@ endif
aix5_ppc_64_CONFIG_ADDITIONS=LDFLAGS="-Wl,-bbigtoc -L/usr/lib/threads"
aix5_ppc_32_CONFIG_ADDITIONS=LDFLAGS="-L/usr/lib/threads"
aix7_ppc_64_CONFIG_ADDITIONS=LDFLAGS="-Wl,-bbigtoc -L/usr/lib/threads"
hpux_ia64_CONFIG_ADDITIONS=--without-readline --without-ldap
win32_GPFDIST_LDFLAGS += -L/usr/i686-pc-mingw32/sys-root/mingw/lib -L$(GPPGDIR)/src/bin/gpfdist/ext/lib
win32_GPFDIST_CFLAGS += -I/usr/i686-pc-mingw32/sys-root/mingw/include
......@@ -307,7 +306,6 @@ BLD_LD_LIBRARY_PATH:=$($(BLD_ARCH)_LD_LIBRARY_PATH):$($(BLD_WHERE_THE_LIBRARY_TH
export $(BLD_WHERE_THE_LIBRARY_THINGS_ARE)=$(BLD_LD_LIBRARY_PATH)
# how much of GPDB to build by platform (default is "full")
hpux_ia64_GPDB_BUILDSET=partial
aix5_ppc_64_GPDB_BUILDSET=partial
aix5_ppc_32_GPDB_BUILDSET=partial
aix7_ppc_64_GPDB_BUILDSET=aix_subset
......@@ -349,9 +347,7 @@ define BUILD_STEPS
cd $(BUILDDIR)/src/bin/gpfdist && $(MAKE) install
@$(MAKE) mgmtcopy INSTLOC=$(INSTLOC)
@$(MAKE) copylibs INSTLOC=$(INSTLOC)
if [ "$(findstring hpux_ia64,$(BLD_ARCH))" = "hpux_ia64" ]; then \
cd $(GPMGMT)/bin && $(MAKE) pygresql LDFLAGS="" INSTLOC=$(INSTLOC) ; \
elif [ "$(findstring win,$(BLD_ARCH))" != "win" ]; then \
if [ "$(findstring win,$(BLD_ARCH))" != "win" ]; then \
cd $(GPMGMT)/bin && $(MAKE) pygresql INSTLOC=$(INSTLOC) ; \
fi
@$(MAKE) clients INSTLOC=$(INSTLOC) CLIENTSINSTLOC=$(CLIENTSINSTLOC)
......@@ -386,9 +382,7 @@ define BUILD_STEPS
cp -p $(GPMGMT)/bin/gpload $(INSTLOC)/bin/gpload
cp -p $(GPMGMT)/bin/gpload.py $(INSTLOC)/bin/gpload.py
$(MAKE) copylibs INSTLOC=$(INSTLOC)
if [ "$(findstring hpux_ia64,$(BLD_ARCH))" = "hpux_ia64" ]; then \
cd $(GPMGMT)/bin && $(MAKE) pygresql LDFLAGS="" INSTLOC=$(INSTLOC) ; \
elif [ "$(findstring win,$(BLD_ARCH))" != "win" ]; then \
if [ "$(findstring win,$(BLD_ARCH))" != "win" ]; then \
cd $(GPMGMT)/bin && $(MAKE) pygresql INSTLOC=$(INSTLOC) ; \
fi
$(MAKE) clients INSTLOC=$(INSTLOC) CLIENTSINSTLOC=$(CLIENTSINSTLOC)
......@@ -546,17 +540,12 @@ BLD_OS:=$(shell uname -s)
endif
AIX_CLIENTS_LIBS=libbz2.a libz.a libpq.a liblber*.a libldap*.a libyaml*.a libcrypto.so* libevent*.a
Darwin_CLIENTS_LIBS=libcrypto.*.dylib libssl.*.dylib libpq.*.dylib* libkrb5.*.dylib libcom_err.*.dylib libldap_r-*.dylib libk5crypto.*.dylib libkrb5support.*.dylib liblber-*.dylib libyaml*.dylib
HP-UX_CLIENTS_LIBS=libcrypto.so* libssl.so.* libz.so* libpq.so* libapr* libyaml*so*
Linux_CLIENTS_LIBS=libpq.so*
SunOS_CLIENTS_LIBS=libcrypto.so* libssl.so.* libgcc_s.so.1 libz.so* libpq.so* libk5crypto.so* libkrb5support.so* liblber*.so* libldap_r-*so* libcom_err.so* libkrb5.so* libyaml*so*
define tmpCLIENTS_FILESET_LIB
$($(BLD_OS)_CLIENTS_LIBS)
endef
CLIENTS_FILESET_LIB = $(strip $(tmpCLIENTS_FILESET_LIB))
hpux_ia64_CLIENTS_LIBS_GCC=libgcc_s.so libgcc_s.so.0
hpux_ia64_CLIENTS_LIBS_GCC_LOC=/opt/hp-gcc/lib/hpux64
aix7_ppc_64_CLIENTS_LIBS_GCC=libgcc_s.a
aix7_ppc_64_CLIENTS_LIBS_GCC_LOC=/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.8.5/ppc64/
......
......@@ -31,11 +31,6 @@ case "`uname -s`" in
fi
;;
SunOS)
BLD_ARCH_HOST="sol`uname -r | awk -F. ' {print $2}'`_`isainfo | awk ' {print $1}' | sed -e s/amd64/x86_64/ | sed -e s/sparcv9/sparc_64/`"
;;
AIX)
BLD_ARCH_HOST="aix`uname -v`_`prtconf | grep 'Processor Type' | awk '{print $3}' | perl -p -i -e 's,PowerPC_POWER.,ppc,'`_`prtconf -k | perl -p -i -e 's,Kernel Type: (\d+)-bit,\1,'`"
;;
......
......@@ -59,9 +59,7 @@ PYGRESQL_DIR=PyGreSQL-$(PYGRESQL_VERSION)
pygresql:
@echo "--- PyGreSQL"
. $(prefix)/greenplum_path.sh && unset PYTHONHOME && \
if [ `uname -s` = 'HP-UX' ]; then \
cd $(PYLIB_SRC)/$(PYGRESQL_DIR) && DESTDIR="$(DESTDIR)" CC="$(CC)" LDFLAGS="-L../../../../gpAux/ext/hpux_ia64/python-2.5.6/lib" python setup.py build; \
elif [ "$(BLD_ARCH)" = 'aix7_ppc_64' ]; then \
if [ "$(BLD_ARCH)" = 'aix7_ppc_64' ]; then \
unset PYTHONPATH && cd $(PYLIB_SRC)/$(PYGRESQL_DIR) && DESTDIR="$(DESTDIR)" CC="$(CC)" python_64 setup.py build; \
elif [ `uname -s` = 'OpenBSD' ]; then \
cd $(PYLIB_SRC)/$(PYGRESQL_DIR) && DESTDIR="$(DESTDIR)" CC=cc python setup.py build; \
......@@ -268,11 +266,6 @@ unitdevel:
PYTHONPATH=$(SERVER_SRC):$(SERVER_SBIN):$(PYTHONPATH):$(PYTHONSRC_INSTALL_PYTHON_PATH):$(SRC)/ext:$(SBIN_DIR):$(LIB_DIR):$(PYLIB_DIR)/mock-1.0.1 \
python -m unittest discover --verbose -s $(SRC)/gppylib -p "test_unit*.py"
solarisTest:
@if [ `uname -s` = 'SunOS' ]; then \
echo "SOLARIS" ; \
fi
.PHONY: installcheck
installcheck:
$(MAKE) -C gpload_test $@
......
......@@ -190,8 +190,6 @@ def runCollectionOnServers():
if gpcheck_info.host_type == HostType.GPCHECK_HOSTTYPE_GENERIC_LINUX:
host_type_cl = "--linux"
elif gpcheck_info.host_type == HostType.GPCHECK_HOSTTYPE_GENERIC_SOLARIS:
host_type_cl = "--solaris"
else:
logger.error("Unexpected host_type in runCollectionOnServers")
return True
......@@ -305,73 +303,7 @@ def testConnectEmc(host):
if host.data.connectemc.output != expected:
printError(host.hostname, "Connect EMC is not running on master (try /etc/init.d/connectemc status)")
def testSolarisEtcSystem(host):
requiredValues = { 'rlim_fd_cur' : '65536',
'zfs:zfs_arc_max' : '0x600000000',
'pcplusmp:apic_panic_on_nmi' : '1',
'nopanicdebug' : '1' }
results = dict()
for k in requiredValues.keys():
results[k] = 0
for key in host.data.etc_system.parameters.keys():
if key not in requiredValues:
continue
foundValue = host.data.etc_system.parameters[key]
if foundValue == requiredValues[key]:
results[key] = 1
for k in results.keys():
if results[k]:
continue
printError(host.hostname, "/etc/system is missing expected line 'set %s=%s'" % (k, requiredValues[k]))
def testSolarisEtcProject(host):
requiredValues = { 'default:3::::project.max-sem-ids=(priv,1024,deny);process.max-file-descriptor=(priv,252144,deny)' : 0 }
unexpectedValues = set(['default:3::::'])
for line in host.data.etc_project.lines:
if line in unexpectedValues:
printError(host.hostname, "unexpected line in /etc/project: '%s'" % line)
continue
if line in requiredValues:
requiredValues[line] = 1
for line in requiredValues.keys():
if requiredValues[line]:
continue
printError(host.hostname, "/etc/project is missing expected line '%s'" % line)
def testSolarisEtcUserAttr(host):
requiredValues = { 'gpadmin::::defaultpriv=basic,dtrace_user,dtrace_proc' : 0 }
for line in host.data.etc_user_attr.lines:
if line in requiredValues:
requiredValues[line] = 1
for line in requiredValues.keys():
if requiredValues[line]:
continue
printError(host.hostname, "/etc/user_attr is missing expected line '%s'" % line)
def testBlockdev(host):
......@@ -505,12 +437,6 @@ def testGenericLinuxHost(host):
# test XFS mounts
testLinuxMounts(host)
def testGenericSolarisHost(host):
testSolarisEtcSystem(host)
testSolarisEtcProject(host)
testSolarisEtcUserAttr(host)
def testUnameConsistency():
firstUname = None
......@@ -575,13 +501,6 @@ def testGenericLinuxCluster():
testUnameConsistency()
def testGenericSolarisCluster():
for h in gpcheck_info.hosts.keys():
testGenericSolarisHost(gpcheck_info.hosts[h])
testUnameConsistency()
def getVersionNumberFromConfigFile(file):
......@@ -639,8 +558,6 @@ def runTests():
if gpcheck_info.host_type == HostType.GPCHECK_HOSTTYPE_GENERIC_LINUX:
testGenericLinuxCluster()
elif gpcheck_info.host_type == HostType.GPCHECK_HOSTTYPE_GENERIC_SOLARIS:
testGenericSolarisCluster()
else:
printWarning("No tests exist for this platform in gpcheck")
......@@ -687,9 +604,6 @@ def checkPlatform():
if SYSTEM.getName() == 'linux':
gpcheck_info.host_type = HostType.GPCHECK_HOSTTYPE_GENERIC_LINUX
return False
elif SYSTEM.getName() == 'sunos':
gpcheck_info.host_type = HostType.GPCHECK_HOSTTYPE_GENERIC_SOLARIS
return False
printWarning("No tests exist for this platform in gpcheck")
return True
......
......@@ -127,8 +127,6 @@ def getPlatform():
return 'linux'
if sys.platform.find('darwin') >= 0:
return 'darwin'
if sys.platform.find('sunos5') >= 0:
return 'sunos5'
return '?'
......@@ -152,17 +150,6 @@ def getMemory():
val = int(word_list[1])
return val
if getPlatform() == 'sunos5':
ok, out = run("sh -c \"/usr/sbin/prtconf | awk '/^Memory/{print}'\"")
if not ok:
return 0
word_list = out.strip().split(' ')
val = int(word_list[2])
factor = word_list[3]
if factor == 'Megabytes':
return val * 1024 * 1024
return 0
return 0
......
......@@ -2888,10 +2888,6 @@ class gpload:
else:
self.log(self.INFO, 'gpload failed')
## MPP-19015 - Extra python thread shutdown time is needed on HP-UX
if platform.uname()[0] == 'HP-UX':
time.sleep(1)
if __name__ == '__main__':
g = gpload(sys.argv[1:])
......
......@@ -22,12 +22,11 @@ logger = get_default_logger()
# global variable for our platform
SYSTEM = "unknown"
SUNOS = "sunos"
LINUX = "linux"
DARWIN = "darwin"
FREEBSD = "freebsd"
OPENBSD = "openbsd"
platform_list = [SUNOS, LINUX, DARWIN, FREEBSD, OPENBSD]
platform_list = [LINUX, DARWIN, FREEBSD, OPENBSD]
curr_platform = platform.uname()[0].lower()
......@@ -247,23 +246,6 @@ class LinuxPlatform(GenericPlatform):
return findCmdInPath('ping6')
class SolarisPlatform(GenericPlatform):
def __init__(self):
pass
def getName(self):
return "sunos"
def getDiskFreeCmd(self):
return findCmdInPath('df') + " -bk"
def getTarCmd(self):
return findCmdInPath('gtar')
def getIfconfigCmd(self):
return findCmdInPath('ifconfig') + ' -a inet'
class DarwinPlatform(GenericPlatform):
def __init__(self):
pass
......@@ -718,9 +700,7 @@ def getDescendentProcesses(pid):
# --------------global variable initialization ----------------------
if curr_platform == SUNOS:
SYSTEM = SolarisPlatform()
elif curr_platform == LINUX:
if curr_platform == LINUX:
SYSTEM = LinuxPlatform()
elif curr_platform == DARWIN:
SYSTEM = DarwinPlatform()
......
......@@ -4,15 +4,12 @@ class HostType:
GPCHECK_HOSTTYPE_UNDEFINED = 0
GPCHECK_HOSTTYPE_APPLIANCE = 1
GPCHECK_HOSTTYPE_GENERIC_LINUX = 2
GPCHECK_HOSTTYPE_GENERIC_SOLARIS = 3
def hosttype_str(type):
if type == HostType.GPCHECK_HOSTTYPE_APPLIANCE:
return "GPDB Appliance"
elif type == HostType.GPCHECK_HOSTTYPE_GENERIC_LINUX:
return "Generic Linux Cluster"
elif type == HostType.GPCHECK_HOSTTYPE_GENERIC_SOLARIS:
return "Generic Solaris Cluster"
else:
return "Undetected Platform"
......@@ -185,50 +182,6 @@ class mounts:
output = "%s\n%s" % (output, self.entries[k].__str__())
return output
class solaris_etc_system:
def __init__(self):
self.parameters = dict() # dictionary of values
self.errormsg = None
class solaris_etc_project:
def __init__(self):
self.lines = list() # list of lines in the file
self.errormsg = None
class solaris_etc_user_attr:
def __init__(self):
self.lines = list() # list of lines in the file
self.errormsg = None
class GenericSolarisOutputData:
def __init__(self):
self.etc_system = None
self.etc_project = None
self.etc_user_attr = None
self.uname = None
def __str__(self):
grc = "============= /etc/system====================\n"
gre = "============= /etc/system ERRORMSG===========\n"
output = "%s%s\n%s%s" % (grc, self.etc_system.parameters.__str__(), gre, self.etc_system.errormsg)
grc = "============= /etc/project===================\n"
gre = "============= /etc/project ==================\n"
output = "%s\n%s%s\n%s%s" % (output, grc, self.etc_project.lines.__str__(), gre, self.etc_project.errormsg)
grc = "============= /etc/user_att==================\n"
gre = "============= /etc/user_att==================\n"
output = "%s\n%s%s\n%s%s" % (output, grc, self.etc_user_attr.lines.__str__(), gre, self.etc_user_attr.errormsg)
grc = "============= UNAME==========================\n"
gre = "============= UNAME ERRORMSG=================\n"
output = "%s\n%s%s\n%s%s" % (output, grc, self.uname.__str__(), gre, self.uname.errormsg)
return output
class GenericLinuxOutputData:
def __init__(self):
self.mounts = None
......
......@@ -10,7 +10,6 @@ try:
from gppylib import gplog, pgconf
from gppylib.commands import gp
from gppylib.commands.base import Command, ExecutionError
from gppylib.commands.unix import curr_platform, SUNOS
from gppylib.db import dbconn
from gppylib.gparray import GpArray
from gppylib.gpversion import GpVersion
......@@ -190,10 +189,6 @@ class GpPkgProgram:
BuildGppkg(self.build, None).run()
return
#Check for RPM and Solaris OS
if curr_platform == SUNOS:
raise ExceptionNoStackTraceNeeded('gppkg is not supported on Solaris')
if platform.linux_distribution()[0] == 'Ubuntu':
try:
cmd = Command(name='Check for dpkg', cmdStr='dpkg --version')
......
......@@ -121,8 +121,8 @@ def parseargs():
logger.error("GPHOME not set")
return True
if SYSTEM.getName() != "linux" and SYSTEM.getName() != "sunos":
logger.error("This utility is only supported on the linux and solaris operating system")
if SYSTEM.getName() != "linux":
logger.error("This utility is only supported on the linux operating system")
return True
if SYSTEM.getName() == "linux":
......
......@@ -37,16 +37,6 @@ GP_UNIQUE_COMMAND=gpstart
findCmdInPath() {
cmdtofind=$1
if [ $cmdtofind = 'awk' ] && [ `uname` = SunOS ]; then
if [ -f "/usr/xpg4/bin/awk" ]; then
CMD=/usr/xpg4/bin/awk
echo $CMD
return
else
echo $cmdtofind
return "Problem in gp_bash_functions, command '/usr/xpg4/bin/awk' not found. You will need to edit the script named gp_bash_functions.sh to properly locate the needed commands for your platform."
fi
fi
for pathel in ${CMDPATH[@]}
do
CMD=$pathel/$cmdtofind
......@@ -1299,22 +1289,6 @@ LOG_FILE=$DEFLOGDIR/${PROG_NAME}_${CUR_DATE}.log
#Set up OS type for scripts to change command lines
OS_TYPE=`uname -s|tr '[A-Z]' '[a-z]'`
case $OS_TYPE in
sunos ) IPV4_ADDR_LIST_CMD="$IFCONFIG -a4"
IPV6_ADDR_LIST_CMD="$IFCONFIG -a6"
PS_TXT="-ef"
LIB_TYPE="LD_LIBRARY_PATH"
ZCAT=gzcat
# MPP-15890
PG_METHOD=ident
HOST_ARCH_TYPE="uname -i"
NOLINE_ECHO=/usr/bin/echo
DEFAULT_LOCALE_SETTING=en_US.UTF-8
MAIL=/bin/mailx
PING_TIME="1"
DF=`findCmdInPath df`
# Multi-byte tr needed on Solaris to handle [:upper:], [:lower:], etc.
MBTR=/usr/xpg4/bin/tr
DU_TXT="-s" ;;
linux ) IPV4_ADDR_LIST_CMD="`findCmdInPath ip` -4 address show"
IPV6_ADDR_LIST_CMD="`findCmdInPath ip` -6 address show"
PS_TXT="ax"
......
......@@ -46,8 +46,6 @@ def getPlatform():
return 'linux'
if sys.platform.find('darwin') >= 0:
return 'darwin'
if sys.platform.find('sunos5') >= 0:
return 'sunos5'
return '?'
......@@ -71,17 +69,6 @@ def getMemory():
val = int(mem_string_list[1])
return val
if getPlatform() == 'sunos5':
ok, out = run("sh -c \"/usr/sbin/prtconf | awk '/^Memory/{print}'\"")
if not ok:
return '?'
mem_string_list = out.strip().split(' ')
val = int(mem_string_list[2])
factor = mem_string_list[3]
if factor == 'Megabytes':
return val * 1024 * 1024
return '?'
return '?'
......
......@@ -233,10 +233,6 @@ To stop gpfdist when it is running in the background:
ps ax | grep gpfdist
OR on Solaris
ps -ef | grep gpfdist
--Then kill the process, for example:
kill 3456
......
......@@ -52,7 +52,6 @@ if getpass.getuser() != "root":
sys.stderr.write("this utility must be run as root\n")
sys.exit(1)
####################################################################################################
if SYSTEM.getName() == "linux":
cmdstr = 'usermod -p "%s" %s' % (crypt.crypt(options.password, options.password), options.user)
......@@ -63,48 +62,7 @@ if SYSTEM.getName() == "linux":
sys.exit(1)
else:
sys.exit(0)
####################################################################################################
if SYSTEM.getName() != "sunos":
sys.stderr.write("linux and solaris are the only operating systems supported by this utility\n")
sys.exit(1)
# SOLARIS password change
# New Password:
# Re-enter new Password:
# passwd: They don't match.
# passwd: password successfully changed for ivanfoo
done = False
child = None
try:
cmdstr = "passwd %s" % options.user
child = pexpect.spawn(cmdstr)
index = 0
while 1:
index = child.expect(["match", "success", "Password", pexpect.EOF, pexpect.TIMEOUT])
if index == 0:
sys.stderr.write("passwords did not match\n")
sys.exit(1)
elif index == 1:
child.close
sys.exit(0)
elif index == 2:
child.sendline(options.password)
continue
elif index == 3:
sys.stderr.write("error calling passwd\n")
sys.exit(1)
elif index == 4:
sys.stderr.write("timeout calling passwd\n")
sys.exit(1)
else:
sys.stderr.write("error2 calling passwd\n")
sys.exit(1)
except Exception, e:
sys.stderr.write("Exception running cmd: %s\n" % cmdstr)
sys.stderr.write("%s\n" % e.__str__())
else:
sys.stderr.write("linux is the only operating system supported by this utility\n")
sys.exit(1)
#!/usr/bin/env python
'''
USAGE: gpcheck_hostdump [--appliance] [--linux] [--solaris]
USAGE: gpcheck_hostdump [--appliance] [--linux]
where --appliance will do a dump of appliance server
where --linux will do a dump of a generic linux server
where --solaris will do a dump of a generic solaris server
'''
import os, sys, re, tempfile, subprocess, pickle, glob, stat, time
......@@ -11,10 +10,9 @@ import os, sys, re, tempfile, subprocess, pickle, glob, stat, time
try:
from optparse import Option, OptionParser
from gppylib.gpparseopts import OptParser, OptChecker
from gppylib.gpcheckutil import HostType, ApplianceOutputData, GenericLinuxOutputData, GenericSolarisOutputData
from gppylib.gpcheckutil import HostType, ApplianceOutputData, GenericLinuxOutputData
from gppylib.gpcheckutil import chkconfig, omreport, grubconf, mounts, GpMount, GpMount, inittab, ntp
from gppylib.gpcheckutil import securetty, ioschedulers, blockdev, bcu, rclocal, sysctl, limitsconf, limitsconf_entry, uname, connectemc
from gppylib.gpcheckutil import solaris_etc_system, solaris_etc_project, solaris_etc_user_attr
except ImportError, e:
sys.exit('Cannot import modules. Please check that you have sourced greenplum_path.sh. Detail: ' + str(e))
......@@ -640,90 +638,6 @@ def collectSecuretty():
return data
# returns poulated object of type: solaris_etc_system
def collectSolarisEtcSystem():
# create dictionary
data = solaris_etc_system()
# comments begin with either a * or #
# lines we care about look like: set rlim_fd_max=262144
try:
for line in open("/etc/system", "r"):
line = line.strip()
if line.startswith("#"):
continue
if line.startswith("*"):
continue
words = line.split("set ")
if len(words) != 2:
continue
words = words[1].split("=")
if len(words) != 2:
continue
key = words[0].strip()
value = words[1].strip()
data.parameters[key] = value
except Exception, e:
data.errormsg = e.__str__()
return data
# returns poulated object of type: solaris_etc_project
def collectSolarisEtcProject():
# store list of lines
# ignore lines that start with # or do not contain :
data = solaris_etc_project()
try:
for line in open("/etc/project", "r"):
val = line.strip()
if val.startswith("#"):
continue
if not re.search(":", val):
continue
data.lines.append(val)
except Exception, e:
data.errormsg = e.__str__()
return data
# returns poulated object of type: solaris_etc_user_attr
def collectSolarisEtcUserAttr():
# store list of lines
# ignore lines that start with # or do not contain :
data = solaris_etc_user_attr()
try:
for line in open("/etc/user_attr", "r"):
val = line.strip()
if val.startswith("#"):
continue
if not re.search(":", val):
continue
data.lines.append(val)
except Exception, e:
data.errormsg = e.__str__()
return data
def processGenericSolarisServer():
global output
output = GenericSolarisOutputData()
output.etc_system = collectSolarisEtcSystem()
output.etc_project = collectSolarisEtcProject()
output.etc_user_attr = collectSolarisEtcUserAttr()
output.uname = collectUname()
def processGenericLinuxServer():
global output
......@@ -767,7 +681,6 @@ def parseargs():
parser.add_option('-h', '-?', '--help', action='store_true')
parser.add_option('--appliance', action='store_true')
parser.add_option('--linux', action='store_true')
parser.add_option('--solaris', action='store_true')
(options, args) = parser.parse_args()
global gphome
......@@ -780,9 +693,6 @@ def parseargs():
print __doc__
return True
if options.solaris:
hosttype = HostType.GPCHECK_HOSTTYPE_GENERIC_SOLARIS
if options.linux:
hosttype = HostType.GPCHECK_HOSTTYPE_GENERIC_LINUX
......@@ -803,8 +713,6 @@ if hosttype == HostType.GPCHECK_HOSTTYPE_APPLIANCE:
processApplianceServer()
elif hosttype == HostType.GPCHECK_HOSTTYPE_GENERIC_LINUX:
processGenericLinuxServer()
elif hosttype == HostType.GPCHECK_HOSTTYPE_GENERIC_SOLARIS:
processGenericSolarisServer()
(fd, filename) = tempfile.mkstemp(dir='/tmp', prefix='gpcheck_dump', text=True)
fd = open(filename, "wb")
......
......@@ -985,7 +985,7 @@ def impl(context, second):
def get_opened_files(filename, pidfile):
cmd = "if [ `uname -s` = 'SunOS' ]; then CMD=pfiles; else CMD='lsof -p'; fi && PATH=$PATH:/usr/bin:/usr/sbin $CMD `cat %s` | grep %s | wc -l" % (
cmd = "PATH=$PATH:/usr/bin:/usr/sbin lsof -p `cat %s` | grep %s | wc -l" % (
pidfile, filename)
return commands.getstatusoutput(cmd)
......
......@@ -30,8 +30,6 @@ class Gpfdist:
self.host = remoteHost
self.ps_command = 'ps'
self.source_file = remote_source_file
if platform.system() in ['SunOS']:
self.ps_command = '/bin/ps'
def startGpfdist(self):
if self.host in ('127.0.0.1',socket.gethostbyname(socket.gethostname()),socket.gethostname(),'localhost'):
......
......@@ -2,12 +2,6 @@
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
BLD_OS := $(shell uname -s)
BLD_OS_VER := $(shell uname -r)
ifneq "$(findstring $(BLD_OS)-$(BLD_OS_VER),SunOS-5.8 SunOS-5.9)" ""
BLD_CPPFLAGS_SOLARIS_OLD_VERSIONS=-D_REENTRANT
endif
ifdef srcdir
INCDIR= $(srcdir)/include
SRCDIR= $(srcdir)/src
......@@ -26,7 +20,7 @@ OBJS = mapred_test.o
include $(top_srcdir)/src/Makefile.shlib
override CPPFLAGS += $(BLD_CPPFLAGS_SOLARIS_OLD_VERSIONS) -I$(SRCDIR) -I$(INCDIR) -I$(libpq_srcdir)
override CPPFLAGS += -I$(SRCDIR) -I$(INCDIR) -I$(libpq_srcdir)
FILES = main.o mapred.o parse.o yaml_scan.o yaml_parse.o
GENFILES = yaml_parse.h yaml_parse.c yaml_scan.c yaml_scan.h
......
if test "$GCC" != yes ; then
CC="$CC -Xa" # relaxed ISO C mode
CFLAGS="-v -DSUNOS_CC" # -v is like gcc -Wall
if test "$enable_debug" != yes; then
CFLAGS="$CFLAGS -O" # any optimization breaks debug
fi
fi
......@@ -526,56 +526,27 @@ sub do_ps_pids
my $pidlist = [];
my $pidh = {};
if ($Config{'osname'} =~ m/solaris|sunos/i)
{
# MPP-10643: fix truncated command args on solaris
my $cmd = '/usr/ucb/ps -auxww | grep -v grep | grep gptorment | grep ' . $uid;
my $psout = `$cmd`;
my @lines = split(/\n/, $psout);
for my $lin (@lines)
{
my @foo = split(/\s+/, $lin, 3);
next
unless (3 == scalar(@foo));
shift @foo;
my $cmd = 'ps auxww | grep -v grep | grep gptorment | grep ' . $uid;
my $pid = shift @foo;
push @{$pidlist}, $pid;
my $psout = `$cmd`;
$pidh->{$pid} = 1;
my @lines = split(/\n/, $psout);
}
}
else # linux or osx
for my $lin (@lines)
{
my $cmd = 'ps auxww | grep -v grep | grep gptorment | grep ' . $uid;
my $psout = `$cmd`;
my @foo = split(/\s+/, $lin, 3);
my @lines = split(/\n/, $psout);
next
unless (3 == scalar(@foo));
for my $lin (@lines)
{
my @foo = split(/\s+/, $lin, 3);
next
unless (3 == scalar(@foo));
shift @foo;
shift @foo;
my $pid = shift @foo;
my $pid = shift @foo;
push @{$pidlist}, $pid;
push @{$pidlist}, $pid;
$pidh->{$pid} = 1;
$pidh->{$pid} = 1;
}
}
return ($pidh, $pidlist);
} # end do_ps_pids
......
......@@ -20,10 +20,6 @@
-- m/ERROR\:\s+external table .* command ended with .*sh: 1: .*NOT FOUND.*/i
-- s/ sh: 1: / sh: /
--
-- # remove cannot open - solaris
-- m/ERROR\:\s+external table .* command ended with .*cat\: cannot open.*/i
-- s/cat\: cannot open (.*)$/cat\: $1\: NO SUCH FILE/
--
-- m/DETAIL: Found \d+ URLs and \d+ primary segments./
-- s/Found.+//
--
......
......@@ -20,10 +20,6 @@
-- m/ERROR\:\s+external table .* command ended with .*sh: 1: .*NOT FOUND.*/i
-- s/ sh: 1: / sh: /
--
-- # remove cannot open - solaris
-- m/ERROR\:\s+external table .* command ended with .*cat\: cannot open.*/i
-- s/cat\: cannot open (.*)$/cat\: $1\: NO SUCH FILE/
--
-- m/DETAIL: Found \d+ URLs and \d+ primary segments./
-- s/Found.+//
--
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册