* [PATCH] instaweb: restart server if already running
@ 2009-11-23 7:09 Stephen Boyd
0 siblings, 0 replies; only message in thread
From: Stephen Boyd @ 2009-11-23 7:09 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
Running 'git instaweb' when an instaweb server is already running will
fail (at least when the port is the same) and overwrite the pid file
used to track the currently running server. This turns out to be
especially annoying when the user tries to stop the previously running
server with 'git instaweb --stop' and is instead greeted with an error
message because the pid file has been destroyed.
Instead of allowing a user to start two instaweb servers, stop the
currently running server first and then start the new one. This should
be fine because it was never really possible to start two instaweb
servers in the first place due to the pid file issue outlined above.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
git-instaweb.sh | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 622a5f0..ffc2ab6 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -73,6 +73,11 @@ resolve_full_httpd () {
}
start_httpd () {
+ if test -f "$fqgitdir/pid"; then
+ say "Instance already running. Restarting..."
+ stop_httpd
+ fi
+
# here $httpd should have a meaningful value
resolve_full_httpd
--
1.6.5.3.299.gb65c9
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-23 7:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 7:09 [PATCH] instaweb: restart server if already running Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox