Webdevelopment
Drupal
Betriebssysteme
Design
Sonstige
Di., 05/11/2013 - 22:07
Body
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/507292Beispiel: Solr
Erzeuge Datei- sudo nano /etc/init.d/solr
- #!/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
- sudo chmod 755 /etc/init.d/solr
- sudo update-rc.d solr defaults
Add new comment