git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] instaweb: Be more clear if httpd or the browser fail

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 26, 2006, 21:11 UTC
Message-ID
<Pine.LNX.4.63.0607262310350.29667@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<Pine.LNX.4.63.0607262153380.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
On Wed, 26 Jul 2006, Johannes Schindelin wrote:
> Well, the fallback mechanism might not be that useful anyway: if you have 
> apache, you have to specify the modules path. I'll do a patch instead 
> which exits cleanly if either $httpd or $browser could not be executed, 
> okay?
Here you are
 git-instaweb.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 1d3ea73..585ad7c 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -54,6 +54,10 @@ start_httpd () {
 			fi
 		done
 	fi
+	if test $? != 0; then
+		echo "Could not execute http daemon $httpd."
+		exit 1
+	fi
 }
 
 stop_httpd () {
@@ -189,7 +193,7 @@ EOF
 	else
 		# plain-old CGI
 		list_mods=`echo "$httpd" | sed "s/-f$/-l/"`
-		$list_mods | grep 'mod_cgi\.c' >/dev/null || \
+		$list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
 		echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
 		cat >> "$conf" <<EOF
 AddHandler cgi-script .cgi
@@ -239,4 +243,5 @@ esac
 
 start_httpd
 test -z "$browser" && browser=echo
-$browser http://127.0.0.1:$port
+url=http://127.0.0.1:$port
+$browser $url || echo $url
-- 
1.4.2.rc2.g84db
Previous: Johannes Schindelin
Message 4 of 4 in “git-instaweb: Fall back to Apache when LigHTTP was not found”
  1. 4/5 git-instaweb: Fall back to Apache when LigHTTP was not foundJohannes Schindelin, Jul 26, 2006
  2. Junio C HamanoJul 26, 2006
  3. Johannes SchindelinJul 26, 2006
  4. instaweb: Be more clear if httpd or the browser failJohannes Schindelin, Jul 26, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.