#! /bin/sh     # /etc/init.d/hg     #           ### BEGIN INIT INFO     # Provides:          asagi     # Required-Start:    $remote_fs $syslog     # Required-Stop:     $remote_fs $syslog     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Runs asagi at the startup.     # Description:       Runs asagi at the startup.     ### END INIT INFO           # Carry out specific functions when asked to by the system     case "$1" in       start)         echo "Starting Asagi"         exec /full/path/to/java -Xmx256m -XX:+UseParNewGC -XX:MaxPermSize=24m -jar /full/path/to/asagi.jar         echo "[OK]"         ;;       stop)         echo "Stopping Asagi"         kill -9 $(pidof java)         echo "[OK]"         ;;       *)         echo "Usage: /etc/init.d/ {start|stop}"         exit 1         ;;     esac           exit 0