From 37e1cb139d67209fd4f627e956a3a922ddfe4b9f Mon Sep 17 00:00:00 2001 From: f1ori Date: Fri, 9 Jan 2009 20:53:08 +0000 Subject: [PATCH] * some improvements of the initscript for debian git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5462 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- addon/yacyInit.m4 | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/addon/yacyInit.m4 b/addon/yacyInit.m4 index 3fa10f727..141192986 100644 --- a/addon/yacyInit.m4 +++ b/addon/yacyInit.m4 @@ -85,7 +85,7 @@ ifdef(`Fedora', `dnl [ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME ')dnl -if [ "$(id -u)" != "0" ] ; then +if [ "$(id -u)" != "0" -a "$(whoami)" != "$USER" ] ; then echo "please run this script as root!" exit 4 fi @@ -126,16 +126,29 @@ for name in /usr/share/java/yacy/*.jar; do CP=$CP:$name done ifdef(`Debian', ` -#CP="$CP:/usr/share/java/javatar.jar" -#CP="$CP:/usr/share/java/commons-httpclient.jar" -#CP="$CP:/usr/share/java/commons-logging.jar" -#CP="$CP:/usr/share/java/commons-codec.jar" -#CP="$CP:/usr/share/java/commons-discovery.jar" -#CP="$CP:/usr/share/java/pdfbox.jar" -#CP="$CP:/usr/share/java/jakarta-poi.jar" -#CP="$CP:/usr/share/java/oro.jar" -#CP="$CP:/usr/share/java/xerces.jar" -#CP="$CP:/usr/share/java/jsch.jar" +CP="$CP:/usr/share/java/javatar.jar" +CP="$CP:/usr/share/java/commons-httpclient.jar" +CP="$CP:/usr/share/java/commons-fileupload.jar" +CP="$CP:/usr/share/java/commons-logging.jar" +CP="$CP:/usr/share/java/commons-codec.jar" +CP="$CP:/usr/share/java/commons-discovery.jar" +CP="$CP:/usr/share/java/commons-io.jar" +CP="$CP:/usr/share/java/pdfbox.jar" +CP="$CP:/usr/share/java/bcprov.jar" +CP="$CP:/usr/share/java/bcmail.jar" +CP="$CP:/usr/share/java/jakarta-poi.jar" +CP="$CP:/usr/share/java/jakarta-poi-scratchpad.jar" +CP="$CP:/usr/share/java/oro.jar" +CP="$CP:/usr/share/java/xerces.jar" +CP="$CP:/usr/share/java/jsch.jar" +CP="$CP:/usr/share/java/ant.jar" # bzip-stuff +CP="$CP:/usr/share/java/jmimemagic.jar" +CP="$CP:/usr/share/java/log4j-1.2.jar" +CP="$CP:/usr/share/java/odfutils.jar" +CP="$CP:/usr/share/java/jrpm.jar" +CP="$CP:/usr/share/java/tmextractors.jar" +CP="$CP:/usr/share/java/servlet-api.jar" +CP="$CP:/usr/share/java/j7zip.jar" ')dnl CLASSPATH=$CP @@ -196,6 +209,7 @@ ifdef(`ArchLinux', ` stat_done ')dnl RETVAL=0 + chown yacy:root $PID_FILE else ifdef(`Debian', ` echo "failed." @@ -258,7 +272,9 @@ ifdef(`Debian', `KILL_YACY_WITH_START_STOP_DAEMON()')dnl sleep 1 pidno=$( ps ax | grep $pid | awk '{ print $1 }' | grep $pid ) done - rm $PID_FILE + if [ "$2" != "--leave-pidfile" ]; then + rm $PID_FILE + fi cd - >/dev/null ifdef(`Debian', ` echo "$NAME." @@ -279,13 +295,16 @@ ifdef(`ArchLinux', ` ;; restart) - $0 stop + $0 stop --leave-pidfile sleep 1 - $0 start + $0 start ;; reload) $0 restart ;; + force-reload) + $0 restart + ;; status) # needed by Fedora if [ -n "$pidno" ]; then