Last month I mentioned that I was having problems with script that would
start Nutch. The script (below) works fine once the machine is up, but it
doesn't start up Nutch on a reboot (just now tested this as it is a remote
machine). The script is in /etc/init.d and there are links to it from
/etc/rc?d. I've read that a common problem is not having all the
environment variables you need, (I looked at the results of env when
logged on a regular user). Any ideas? FWIW, I'm running Debian etch.
- Bill
#!/bin/bash
#
# tomcat
#
# Start up the Tomcat servlet engine.
#
# This relies on the searcher.dir in nutch-site.xml to set up the
# segment directory for Nutch.
#
# largely from http://www.raibledesigns.com/tomcat/boot-howto.html
## environment variables (from /etc/profile)
PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/local/SUNWappserver/bin
CLASSPATH="/usr/local/SUNWappserver/jdk/jre/lib"
JAVA_HOME="/usr/local/SUNWappserver/jdk"
CATALINA_HOME="/usr/local/jakarta-tomcat-5"
JAVA_OPTS="-Xmx1024m -Xms512m"
## more environment variables (when tomcat shuts down)
CATALINA_BASE="/usr/local/jakarta-tomcat-5"
CATALINA_TMPDIR="/usr/local/jakarta-tomcat-5/temp"
case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
$CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
$CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
> Thanks -- after a rebuild and redeploy this works fine. The init.d tomcat
> script works OK, but I have yet to try a reboot as I'm not near the server
> at the moment.
>
> Thanks,
>
> Bill
>
>
> Matthew said:
>
> > You don't need to cd to the nutch directory for the startup script. All
> > you need to do is edit the nutch-site.xml that is found within the nutch
> > servlet and include a "searcher directory" property that tells tomcat
> > where to look for the crawl db.
> >
> > So if you have nutch 0.8, edit the file
> > TOMCAT_PATH/webapps/NUTCH_DIR/WEB-INF/classes/nutch-site.xml and include
> > the following:
> >
> > <property>
> > <name>searcher.dir</name>
> > <value>/your_index_folder_path</value>
> > </property>
> >
> >
> > I believe the "your_index_folder_path" is the path to your crawl
> > directory. However, if that doesn't work, make it the path to the index
> > folder within your crawl directory.
> >
> > Now, save that and make sure your script just starts tomcat on init and
> > everything should work fine for you.
> >
> > Matt
> >
> >
> > Bill Goffe wrote:
> > >I'd like to start Nutch automatically when I reboot. I wrote a real rough
> > >script (see below) that works on my Debian system when the system is up,
> > >but I get nothing on a reboot (and the links are set to the
> > >/etc/init.d/nutch). Any hints, ideas, or suggestions? I checked the FAQ
> > >and the archive but didn't see anything. In addition, it would be great to
> > >get messages going into /var/log to help figure out what is going on but
> > >I've had no luck doing that.
> > >
> > >Thanks,
> > >
> > > Bill
> > >
> > >## Start and stop Nutch. Note how specific it is to
> > >## (i) Tomcat (typically $CATALINA_HOME/bin/shutdown.sh
> > >## or $CATALINA_HOME/bin/startup.sh) and (ii) the
> > >## directory with the most recent fetch results.
> > >
> > >## PATH stuff
> > >PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
> > >PATH=$PATH:/usr/local/SUNWappserver/bin
> > >CLASSPATH=/usr/local/SUNWappserver/jdk/jre/lib
> > >JAVA_HOME=/usr/local/SUNWappserver/jdk
> > >CATALINA_HOME=/usr/local/jakarta-tomcat-5
> > >JAVA_OPTS="-Xmx1024m -Xms512m"
> > >
> > >case "$1" in
> > >start)
> > > cd /home/bgoffe/nc/40 ## start in correct directory
> > > /usr/local/jakarta-tomcat-5/bin/startup.sh
> > > ;;
> > >
> > >stop)
> > > /usr/local/jakarta-tomcat-5/bin/shutdown.sh
> > > ;;
> > >
> > >force-reload|restart)
> > > /usr/local/jakarta-tomcat-5/bin/shutdown.sh
> > > cd /home/bgoffe/nc/40
> > > /usr/local/jakarta-tomcat-5/bin/startup.sh
> > > ;;
> > >
> > >*)
> > > echo "Usage: /etc/init.d/nutch {start|stop|force-reload|restart}"
> > > exit 1
> > > ;;
> > >
> > >esac
> > >
> > >exit 0
> > >
> > >
>
> --
> *------------------------------------------------------*
> | Bill Goffe [EMAIL PROTECTED] |
> | Department of Economics voice: (315) 312-3444 |
> | SUNY Oswego fax: (315) 312-5444 |
> | 416 Mahar Hall <http://cook.rfe.org> |
> | Oswego, NY 13126 |
> *--------*------------------------------------------------------*-----------*
> | "An orange freezes to the hardness of a baseball; a potato cannot be |
> | dented with a hammer." |
> | -- A description of conditions that Indian and Pakistani soldiers face |
> | in their dispute in the western Himalayas near and on Siachen |
> | Glacier. "Frozen in Fury at the Room of the World," New York Times, |
> | May 23, 1999. |
> *---------------------------------------------------------------------------*
>
--
*------------------------------------------------------*
| Bill Goffe [EMAIL PROTECTED] |
| Department of Economics voice: (315) 312-3444 |
| SUNY Oswego fax: (315) 312-5444 |
| 416 Mahar Hall <http://cook.rfe.org> |
| Oswego, NY 13126 |
*--------*------------------------------------------------------*-----------*
| "Some predicted the disclosure would set off strong reactions from |
| governments of the target countries." |
| -- A description of how China, Russia, Iraq, North Korea, Iran, Libya |
| and Syria might feel about the revelation that the U.S. has |
| contingency plans to use nuclear weapons against them. "U.S. Works |
| Up Plan for Using Nuclear Arms," Paul Richter, LA Times, |
| March 9, 2002. |
*---------------------------------------------------------------------------*
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nutch-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-general