Netzflut

Webdesign, Webentwicklung, Drupal & Zeuchs

Progamme Linux Autostart

Inhaltsverzeichniss

    Sources

    http://www.debian-administration.org/article/Making_scripts_run_at_boot_time_with_Debian
    http://www.debian-administration.org/articles/28 | GOOD
    http://drupal.org/node/507292

    Beispiel: Solr

    Erzeuge Datei

    sudo nano /etc/init.d/solr

    File:
    Remember to change the SOLR_DIR to your directory

    #!/bin/sh -e
    # Starts, stops, and restarts solr
     
    SOLR_DIR="/apache-solr-nightly/example"
    JAVA_OPTIONS="-Xmx1024m -DSTOP.PORT=8079 -DSTOP.KEY=stopkey -jar start.jar"
    LOG_FILE="/var/log/solr.log"
    JAVA="/usr/bin/java"
     
    case $1 in
    start)
    echo "Starting Solr"
    cd $SOLR_DIR
    $JAVA $JAVA_OPTIONS 2> $LOG_FILE &
    ;;
    stop)
    echo "Stopping Solr"
    cd $SOLR_DIR
    $JAVA $JAVA_OPTIONS --stop
    ;;
    restart)
    $0 stop
    sleep 1
    $0 start
    ;;
     
    echo "Usage: $0 {start|stop|restart}" >&2
    exit 1
    ;;
    esac

    Chmod setzen (755):

    sudo chmod 755 /etc/init.d/solr

    Skript linken:

    sudo update-rc.d solr defaults
    Helpdesk: