components/openstack/swift/patches/orphans.patch
changeset 1944 56ac2df1785b
parent 1896 f83e6dde6c3b
child 5448 56f4540f741d
equal deleted inserted replaced
1943:1a27f000029f 1944:56ac2df1785b
     2 Solaris.
     2 Solaris.
     3 
     3 
     4 diff --git a/bin/swift-orphans b/bin/swift-orphans
     4 diff --git a/bin/swift-orphans b/bin/swift-orphans
     5 --- a/bin/swift-orphans
     5 --- a/bin/swift-orphans
     6 +++ b/bin/swift-orphans
     6 +++ b/bin/swift-orphans
     7 @@ -42,12 +42,12 @@ Example (sends SIGTERM to all orphaned S
     7 @@ -54,12 +54,12 @@ Example (sends SIGTERM to all orphaned S
     8              if name.endswith('.pid'):
     8              if name.endswith('.pid'):
     9                  pids.append(open(os.path.join(root, name)).read().strip())
     9                  pids.append(open(os.path.join(root, name)).read().strip())
    10                  pids.extend(subprocess.Popen(
    10                  pids.extend(subprocess.Popen(
    11 -                    ['ps', '--ppid', pids[-1], '-o', 'pid', '--no-headers'],
    11 -                    ['ps', '--ppid', pids[-1], '-o', 'pid', '--no-headers'],
    12 +                    ['pgrep', '-P', pids[-1]],
    12 +                    ['pgrep', '-P', pids[-1]],
    17 -            ['ps', '-eo', 'etime,pid,args', '--no-headers'],
    17 -            ['ps', '-eo', 'etime,pid,args', '--no-headers'],
    18 +            ['ps', '-eo', 'etime=', '-o' 'pid=', '-o' 'args='],
    18 +            ['ps', '-eo', 'etime=', '-o' 'pid=', '-o' 'args='],
    19              stdout=subprocess.PIPE).communicate()[0].split('\n'):
    19              stdout=subprocess.PIPE).communicate()[0].split('\n'):
    20          if not line:
    20          if not line:
    21              continue
    21              continue
    22 @@ -58,6 +58,7 @@ Example (sends SIGTERM to all orphaned S
    22 @@ -70,6 +70,7 @@ Example (sends SIGTERM to all orphaned S
    23              sys.exit('Could not process ps line %r' % line)
    23              sys.exit('Could not process ps line %r' % line)
    24          if pid in pids:
    24          if pid in pids:
    25              continue
    25              continue
    26 +        # XXX Do we get enough of the arguments to get "once"?
    26 +        # XXX Do we get enough of the arguments to get "once"?
    27          if (not args.startswith('/usr/bin/python /usr/bin/swift-') and
    27          if (not args.startswith('/usr/bin/python /usr/bin/swift-') and