From 594a104c713522c20ba190321a6b614f55d0489a Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Fri, 21 Sep 2007 15:48:15 -0700
Subject: [PATCH] startstop_node.py: fix bug with options passed to restart and
 enable restart --profile

---
 src/allmydata/scripts/startstop_node.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/allmydata/scripts/startstop_node.py b/src/allmydata/scripts/startstop_node.py
index 3988ec3e..ec4fa724 100644
--- a/src/allmydata/scripts/startstop_node.py
+++ b/src/allmydata/scripts/startstop_node.py
@@ -27,6 +27,9 @@ class RestartOptions(BasedirMixin, usage.Options):
          "instead of complaining that you should have used 'start' instead "
          "of 'restart'"],
         ]
+    optFlags = [
+        ["profile", "p", "whether to run under the Python profiler, putting results in \"profiling_results.prof\""],
+        ]
 
 def do_start(basedir, profile=False, out=sys.stdout, err=sys.stderr):
     print >>out, "STARTING", basedir
@@ -125,7 +128,7 @@ def restart(config, stdout, stderr):
         print >>stderr, "not restarting"
         return rc
     for basedir in config['basedirs']:
-        rc = do_start(basedir, stdout, stderr) or rc
+        rc = do_start(basedir, config['profile'], stdout, stderr) or rc
     return rc
 
 
-- 
2.45.2