Changes

From Amahi Wiki
Jump to: navigation, search
155 bytes removed ,  02:35, 13 February 2011
=== Create Init Script (Not Working)===
* To enable FlexRAID to start on boot, create the file named '''flexraid''' and insert the following text:
<pre>#! /bin/sh
# by wyld ### BEGIN INIT INFO # Provides: FlexRAID application instance # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts FlexRAID app # Description: starts instance of FlexRAID app using start-stop-daemon ### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/flexraid:/opt/flexraid/webui
############### EDIT ME ##################
# daemon DAEMON=/home/amahi/openegg/FlexRAID DAEDIR=/home/amahi/openegg/ wDAEDIR=/var/hda/web-apps/flexraid/html NAME="flexraid" DESC="FlexRAID backend and webui" USER="root"
LOGDIR=/var/log RUNDIR=/var/run ARGS=""
############### END EDIT ME ################## test -x $DAEMON || exit 0
test set -x $DAEMON || exit 0e
set case "$1" in start) echo "Starting $DESC: " start-estop-daemon --start --oknodo --background --chdir $DAEDIR --exec $DAEMON start-stop-daemon --start --oknodo --chdir $wDAEDIR --name $NAME.web --startas /bin/sh $wDAEDIR/start.sh echo "[ $NAME ]" ;; stop) echo "Stopping $DESC: " start-stop-daemon --stop --oknodo --exec $DAEMON start-stop-daemon --start --oknodo --chdir $wDAEDIR --name $NAME.web --startas /bin/sh $wDAEDIR/stop.sh echo "[ $NAME ]" ;;
case "$1" in start restart) echo "Starting Restarting $DESC: " start-stop-daemon --start stop --oknodo --background --chdir $DAEDIR --exec $DAEMON start-stop-daemon --start --oknodo --chdir $wDAEDIR --name $NAME.web --startas /bin/sh $wDAEDIR/startstop.sh echo "[ $NAME ]" ;; stop) echo "Stopping $DESC: " sleep 1 start-stop-daemon --stop start --oknodo --background --chdir $DAEDIR --exec $DAEMON start-stop-daemon --start --oknodo --chdir $wDAEDIR --name $NAME.web --startas /bin/sh $wDAEDIR/stopstart.sh echo "[ $NAME ]" ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart}" >&2 exit 1 ;;esac
restart) echo "Restarting $DESC: " start-stop-daemon --stop --oknodo --exec $DAEMON start-stop-daemon --start --oknodo --chdir $wDAEDIR --name $NAME.web --startas /binexit 0>/sh $wDAEDIR/stop.sh sleep 1 start-stop-daemon --start --oknodo --background --chdir $DAEDIR --exec $DAEMON start-stop-daemon --start --oknodo --chdir $wDAEDIR --name $NAME.web --startas /bin/sh $wDAEDIR/start.sh echo "[ $NAME ]" ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart}" pre>&2 exit 1 ;; esac exit 0
* To enable the script to run on boot, do the following:
{{Code|install -m 755 flexraid /etc/init.d/
12,424

edits