Objective C
Sql
code posted
created at 30 May 08:43, updated at 03 Jun 10:41
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
#!/bin/sh # #http://wiki.openkm.com/index.php/Configure_JBoss_service ### BEGIN INIT INFO # Provides: jboss # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start and stop JBoss AS # Description: Enable JBoss AS service provided by daemon. ### END INIT INFO ECHO=/bin/echo TEST=/usr/bin/test JBOSS_USER=jboss JBOSS_IP=0.0.0.0 JBOSS_HOME=/opt/jboss JBOSS_MODE=default JBOSS_START_SCRIPT=$JBOSS_HOME/bin/run.sh JBOSS_STOP_SCRIPT=$JBOSS_HOME/bin/shutdown.sh $TEST -x $JBOSS_START_SCRIPT || exit 0 $TEST -x $JBOSS_STOP_SCRIPT || exit 0 start() { $ECHO "Starting JBoss" $ECHO "su - $JBOSS_USER -c cd $JBOSS_HOME/bin; $JBOSS_START_SCRIPT -c $JBOSS_MODE -b $JBOSS_IP > /dev/null &" su - $JBOSS_USER -c "cd $JBOSS_HOME/bin; $JBOSS_START_SCRIPT -c $JBOSS_MODE -b $JBOSS_IP > /dev/null &" $ECHO "." } stop() { $ECHO -n "Stopping JBoss" su - $JBOSS_USER -c "$JBOSS_STOP_SCRIPT -s $JBOSS_IP > /dev/null &" while [ "$(ps -fu $JBOSS_USER | grep java | grep jboss | wc -l)" -gt "0" ]; do sleep 5; $ECHO -n "." done $ECHO "." } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 30 start ;; *) $ECHO "Usage: jboss {start|stop|restart}" exit 1 esac exit 0 |
1.46 KB in 3 ms with coderay