components/openstack/swift/patches/orphans.patch
branchs11u3-sru
changeset 6035 c9748fcc32de
parent 3178 77584387a894
equal deleted inserted replaced
6016:a477397bba8b 6035:c9748fcc32de
     1 Convert the calls to ps in swift-orphans to calls that will work on
     1 Convert the calls to ps in swift-orphans to calls that will work on
     2 Solaris.
     2 Solaris.
     3 
     3 
     4 diff --git a/bin/swift-orphans b/bin/swift-orphans
     4 --- swift-2.3.0/bin/swift-orphans.~1~	2015-04-30 06:57:42.000000000 -0700
     5 --- a/bin/swift-orphans
     5 +++ swift-2.3.0/bin/swift-orphans	2016-02-08 00:54:16.772518488 -0800
     6 +++ b/bin/swift-orphans
       
     7 @@ -54,12 +54,12 @@ Example (sends SIGTERM to all orphaned S
     6 @@ -54,12 +54,12 @@ Example (sends SIGTERM to all orphaned S
     8              if name.endswith('.pid'):
     7              if name.endswith('.pid'):
     9                  pids.append(open(os.path.join(root, name)).read().strip())
     8                  pids.append(open(os.path.join(root, name)).read().strip())
    10                  pids.extend(subprocess.Popen(
     9                  pids.extend(subprocess.Popen(
    11 -                    ['ps', '--ppid', pids[-1], '-o', 'pid', '--no-headers'],
    10 -                    ['ps', '--ppid', pids[-1], '-o', 'pid', '--no-headers'],
    12 +                    ['pgrep', '-P', pids[-1]],
    11 +                    ['/usr/bin/pgrep', '-P', pids[-1]],
    13                      stdout=subprocess.PIPE).communicate()[0].split())
    12                      stdout=subprocess.PIPE).communicate()[0].split())
    14  
    13  
    15      listing = []
    14      listing = []
    16      for line in subprocess.Popen(
    15      for line in subprocess.Popen(
    17 -            ['ps', '-eo', 'etime,pid,args', '--no-headers'],
    16 -            ['ps', '-eo', 'etime,pid,args', '--no-headers'],
    18 +            ['ps', '-eo', 'etime=', '-o' 'pid=', '-o' 'args='],
    17 +            ['/usr/bin/ps', '-eo', 'etime=', '-o' 'pid=', '-o' 'args='],
    19              stdout=subprocess.PIPE).communicate()[0].split('\n'):
    18              stdout=subprocess.PIPE).communicate()[0].split('\n'):
    20          if not line:
    19          if not line:
    21              continue
    20              continue
    22 @@ -70,6 +70,7 @@ Example (sends SIGTERM to all orphaned S
    21 @@ -70,6 +70,7 @@ Example (sends SIGTERM to all orphaned S
    23              sys.exit('Could not process ps line %r' % line)
    22              sys.exit('Could not process ps line %r' % line)