On machines with more than 1 CPU it is useful to run more than a single
instance of Nutch under the same user.

The attached patch allows the admins to override the default storage
locations for pids and use something instead of $USER for instance
identification.

-- 
Rod Taylor <[EMAIL PROTECTED]>
*** mapred.orig/bin/nutch-daemon.sh	2005-09-27 17:51:38.000000000 -0400
--- nutch-daemon.sh	2005-09-29 14:59:19.000000000 -0400
***************
*** 6,11 ****
--- 6,13 ----
  #
  #   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,47 ****
    NUTCH_LOG_DIR=$PWD
  fi
  
  # some variables
! log=$NUTCH_LOG_DIR/nutch-$command-`hostname`.log
! pid=/tmp/nutch-$USER-$command.pid
  
  case $startStop in
  
--- 41,57 ----
    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-$NUTCH_IDENT_STRING-$command-`hostname`.log
! pid=$NUTCH_PID_DIR/nutch-$NUTCH_IDENT_STRING-$command.pid
  
  case $startStop in
  

Reply via email to