Author: cutting
Date: Thu Sep 29 14:02:22 2005
New Revision: 292548

URL: http://svn.apache.org/viewcvs?rev=292548&view=rev
Log:
Patch to facilitate running multiple daemons of a type on a single machine.

Modified:
    lucene/nutch/branches/mapred/bin/nutch-daemon.sh

Modified: lucene/nutch/branches/mapred/bin/nutch-daemon.sh
URL: 
http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/bin/nutch-daemon.sh?rev=292548&r1=292547&r2=292548&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/bin/nutch-daemon.sh (original)
+++ lucene/nutch/branches/mapred/bin/nutch-daemon.sh Thu Sep 29 14:02:22 2005
@@ -6,6 +6,8 @@
 #
 #   NUTCH_LOG_DIR   Where log files are stored.  PWD by default.
 #   NUTCH_MASTER    host:path where nutch code should be rsync'd from
+#   NUTCH_PID_DIR   The pid files are stored. /tmp by default.
+#   NUTCH_IDENT_STRING   A string representing this instance of nutch. $USER 
by default
 ##
 
 usage="Usage: nutch-daemon [start|stop] [nutch-command] [args...]"
@@ -39,9 +41,17 @@
   NUTCH_LOG_DIR=$PWD
 fi
 
+if [ "$NUTCH_PID_DIR" = "" ]; then
+  NUTCH_PID_DIR=/tmp
+fi
+
+if [ "$NUTCH_IDENT_STRING" = "" ]; then
+  NUTCH_IDENT_STRING=$USER
+fi
+
 # some variables
-log=$NUTCH_LOG_DIR/nutch-$command-`hostname`.log
-pid=/tmp/nutch-$USER-$command.pid
+log=$NUTCH_LOG_DIR/nutch-$NUTCH_IDENT_STRING-$command-`hostname`.log
+pid=$NUTCH_PID_DIR/nutch-$NUTCH_IDENT_STRING-$command.pid
 
 case $startStop in
 


Reply via email to