summaryrefslogtreecommitdiff
path: root/bin/swift-orphans
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@chmouel.com>2013-01-10 15:08:10 +0100
committerChmouel Boudjnah <chmouel@enovance.com>2013-01-21 18:12:17 +0100
commit3282e3885c4387a2147f39d20b1c5902e0336114 (patch)
tree53bfc7b1432cdf44188510284c746cd8ed5e0929 /bin/swift-orphans
parentb8626f966702081138ac9ce9c42dd18dd822cb04 (diff)
downloadswift-3282e3885c4387a2147f39d20b1c5902e0336114.tar.gz
Add --run-dir switch to swift-init
- Add ability to specify an alternative run_dir than the default /var/run/swift. - DocImpact Change-Id: I17677588f2c8da563b7fec2dc4fdc52da87126ed
Diffstat (limited to 'bin/swift-orphans')
-rwxr-xr-xbin/swift-orphans8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/swift-orphans b/bin/swift-orphans
index 3eb799c0e..baf8be73c 100755
--- a/bin/swift-orphans
+++ b/bin/swift-orphans
@@ -6,6 +6,7 @@ import signal
import subprocess
import sys
+from swift.common.manager import RUN_DIR
if __name__ == '__main__':
parser = optparse.OptionParser(usage='''%prog [options]
@@ -28,10 +29,15 @@ Example (sends SIGTERM to all orphaned Swift processes older than two hours):
parser.add_option('-w', '--wide', dest='wide', default=False,
action='store_true',
help="don't clip the listing at 80 characters")
+ parser.add_option('-r', '--run-dir', type="str",
+ dest="run_dir", default=RUN_DIR,
+ help="alternative directory to store running pid files "
+ "default: %s" % RUN_DIR)
(options, args) = parser.parse_args()
pids = []
- for root, directories, files in os.walk('/var/run/swift'):
+
+ for root, directories, files in os.walk(options.run_dir):
for name in files:
if name.endswith('.pid'):
pids.append(open(os.path.join(root, name)).read().strip())