Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

boxgrinder-rest package

  • Loading branch information...
commit 70c66f85a76e2e71361e0c12658d0c8f34c78cd5 1 parent d566143
@goldmann goldmann authored
View
1  specs/boxgrinder-node.spec
@@ -15,6 +15,7 @@ Source2: %{name}.init
Source3: http://repo.boxgrinder.org/boxgrinder/gems/torquebox-messaging-runtime-1.0.0.gem
Source4: http://repo.boxgrinder.org/boxgrinder/gems/torquebox-messaging-client-1.0.0.gem
Source5: http://repo.boxgrinder.org/boxgrinder/gems/torquebox-messaging-container-1.0.0.gem
+Requires: java-1.6.0-openjdk
Requires: shadow-utils
Requires: coreutils
Requires: initscripts
View
94 specs/boxgrinder-rest.spec
@@ -0,0 +1,94 @@
+%define tb_version 1.0.0.Beta19
+%define reflog c950e07
+
+Summary: BoxGrinder REST is a REST service for BoxGrinder
+Name: boxgrinder-rest
+Version: 0.0.1
+Release: 1
+License: LGPL
+BuildArch: noarch
+Group: Development/Tools
+URL: http://www.jboss.org/stormgrind/projects/boxgrinder/rest.html
+Source0: http://github.com/stormgrind/%{name}/tarball/%{version}
+Source1: http://repository.torquebox.org/maven2/releases/org/torquebox/torquebox-bin/%{tb_version}/torquebox-bin-%{tb_version}.zip
+Source2: %{name}.init
+Requires: java-1.6.0-openjdk
+Requires: postgresql-server
+Requires: shadow-utils
+Requires(build): unzip
+Requires: coreutils
+Requires: initscripts
+Requires(post): /sbin/chkconfig
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+%define runuser %{name}
+%define __jar_repack %{nil}
+
+%description
+BoxGrinder REST is a REST service for BoxGrinder
+
+%prep
+%setup -b 0 -n stormgrind-%{name}-%{reflog}
+
+cd %{_topdir}/BUILD
+
+rm -rf torquebox-%{tb_version}-bin
+unzip -q %{SOURCE1}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+install -d -m 755 $RPM_BUILD_ROOT/opt/%{name}-%{version}/%{name}
+install -d -m 755 $RPM_BUILD_ROOT/opt/%{name}-%{version}/torquebox
+
+cd %{_topdir}/BUILD
+
+rm -rf torquebox-%{tb_version}-bin/jboss/server/all
+rm -rf torquebox-%{tb_version}-bin/jboss/server/minimal
+rm -rf torquebox-%{tb_version}-bin/jboss/server/standard
+rm -rf torquebox-%{tb_version}-bin/jboss/server/jbossweb-standalone
+
+# it caused adding bad requires for package
+rm -rf torquebox-%{tb_version}-bin/jboss/bin/jboss_init_solaris.sh
+
+cp -R stormgrind-%{name}-%{reflog}/* $RPM_BUILD_ROOT/opt/%{name}-%{version}/%{name}
+cp -R torquebox-%{tb_version}-bin/* $RPM_BUILD_ROOT/opt/%{name}-%{version}/torquebox
+
+chmod 755 $RPM_BUILD_ROOT/opt/%{name}-%{version}/torquebox/jruby
+
+$RPM_BUILD_ROOT/opt/%{name}-%{version}/torquebox/jruby/bin/jruby -S gem install boxgrinder-core
+
+install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
+
+echo "BG_REST_HOME=/opt/%{name}-%{version}/%{name}" > $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+echo "BG_REST_VERSION=%{version}" >> $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+
+cat > $RPM_BUILD_ROOT/opt/%{name}-%{version}/torquebox/jboss/server/default/deploy/%{name}-rails.yml <<EOF
+---
+application:
+ RAILS_ROOT: /opt/%{name}-%{version}/%{name}
+ RAILS_ENV: production
+web:
+ context: /
+EOF
+
+install -d -m 755 $RPM_BUILD_ROOT%{_initrddir}
+install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/%{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add %{name}
+
+%pre
+/usr/sbin/groupadd -r %{name} 2>/dev/null || :
+/usr/sbin/useradd -c "BoxGrinder REST" -r -s /bin/bash -d /opt/%{name}-%{version} -g %{name} %{name} 2>/dev/null || :
+
+%files
+%defattr(-,%{name},%{name})
+/
+
+%changelog
+* Fri May 21 2010 Marek Goldmann <marek.goldmann@gmail.com> - 0.1.0-1
+- Initial package
View
486 src/boxgrinder-rest.init
@@ -0,0 +1,486 @@
+#!/bin/sh
+#
+# jboss-as6 Start up the JBoss Application Server
+#
+# chkconfig: 2345 84 15
+# description: JBoss Application Server
+# processname: jboss-as6
+# config: /etc/jboss-as.conf
+# pidfile: /var/run/jboss-as6.pid
+
+### BEGIN INIT INFO
+# Provides: jboss-as6
+# Required-Start: $network $syslog
+# Required-Stop: $network
+# Default-Start:
+# Default-Stop:
+# Short-Description: Start up the JBoss Application Server
+# Description: JBoss Application Server
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ ${NETWORKING} = "no" ] && exit 0
+
+NAME=boxgrinder-rest
+
+unset ISBOOT
+if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
+ NAME="${NAME:3}"
+ ISBOOT="1"
+fi
+
+# read in service-specific jboss configuration
+[ -f /etc/sysconfig/${NAME} ] && . /etc/sysconfig/${NAME}
+
+export JAVA_HOME=${JAVA_HOME:-"/usr/lib/jvm/jre"}
+
+# define where JBoss is - this is the directory containing directories log, bin, conf etc
+JBOSS_HOME=${JBOSS_HOME:-"/opt/boxgrinder-rest-$BG_REST_VERSION/torquebox/jboss"}
+
+#make sure java is on your path
+JAVAPTH=${JAVAPTH:-"$JAVA_HOME/bin"}
+
+#define the classpath for the shutdown class
+JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jbossall-client.jar"}
+
+memory=`dmesg | grep ^Memory: | awk '{ print $2 }' | awk -F\/ '{ print $2 }' | sed 's/\k//g'`
+JAVA_OPTS="-Xms$(($memory / 1024 - $memory / 10240))M -Xmx$(($memory / 1024 - $memory / 10240))M -XX:PermSize=$(($memory / 1024 / 4))M -XX:MaxPermSize=$(($memory / 1024 / 4))M -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
+
+IP_ADDRESS=`ip addr list eth0 | grep "inet " | cut -d' ' -f6 | cut -d/ -f1`
+
+JBOSSCONF=${JBOSSCONF:-"default"}
+
+#define the script to use to start jboss
+JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSSCONF"}
+
+#define the user under which jboss will run, or use RUNASIS to run as the current user
+JBOSSUS=${JBOSSUS:-"${NAME}"}
+
+#define the group under which jboss will run
+JBOSSGR=${JBOSSGR:-"${NAME}"}
+
+#define the lock file for this jboss instance
+JBOSSLOCK=/var/lock/subsys/$NAME-$JBOSSCONF
+
+#define the pid file for this jboss instance
+JBOSSPID=/var/run/${NAME}.pid
+
+# Set the defaults.
+LOGFILE=$JBOSS_HOME/server/$JBOSSCONF/log/console.log
+
+#define what will be done with the console log
+JBOSS_CONSOLE=${JBOSS_CONSOLE:-"$JBOSS_HOME/server/$JBOSSCONF/log/console.log"}
+
+#define what IP address for running jboss
+JBOSS_IP=${JBOSS_IP:-"$IP_ADDRESS"}
+
+#define the jgroups UDP group (multicast address) for clustering
+JBOSS_UDP_GROUP=${JBOSS_UDP_GROUP:-"228.1.2.3"}
+
+#define the Http Session Replication UDP port (multicast)
+JBOSS_UDP_PORT_WP=${JBOSS_UDP_PORT_WP:-"45577"}
+
+#define the UDP port for JBoss clustering (multicast)
+JBOSS_UDP_PORT_HA=${JBOSS_UDP_PORT_HA:-"45566"}
+
+#define the UDP port for the ejb3 entity cache cluster (multicast)
+JBOSS_UDP_PORT_EJB3=${JBOSS_UDP_PORT_EJB3:-"43333"}
+
+#define the UDP port for ejb3 sfsb cache cluster (multicast)
+JBOSS_UDP_PORT_EJB3SFSB=${JBOSS_UDP_PORT_EJB3SFSB:-"45551"}
+
+#define the timeout period for starting the server
+JBOSS_START_TIMEOUT=${JBOSS_START_TIMEOUT:-"240"}
+
+#define the timeout period for stopping the server
+JBOSS_STOP_TIMEOUT=${JBOSS_STOP_TIMEOUT:-"180"}
+
+#default run.conf file
+RUN_CONF=$JBOSS_HOME/bin/run.conf
+
+if [ ! -z $JBOSS_IP ]; then
+ JBOSSSH="$JBOSSSH -b $JBOSS_IP"
+fi
+
+# Set the RUN_CONF to config specific, if it exists
+if [ -f $JBOSS_HOME/server/$JBOSSCONF/run.conf ]; then
+ RUN_CONF=$JBOSS_HOME/server/$JBOSSCONF/run.conf
+fi
+
+# Read in run.conf and use them
+if [ -f ${RUN_CONF} ]; then
+ . ${RUN_CONF}
+fi
+
+# Set other parameters to the VM
+[ "x$JBOSS_UDP_GROUP" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.partition.udpGroup=$JBOSS_UDP_GROUP"
+[ "x$JBOSS_UDP_PORT_WP" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.webpartition.mcast_port=$JBOSS_UDP_PORT_WP"
+[ "x$JBOSS_UDP_PORT_HA" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.hapartition.mcast_port=$JBOSS_UDP_PORT_HA"
+[ "x$JBOSS_UDP_PORT_EJB3" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.ejb3entitypartition.mcast_port=$JBOSS_UDP_PORT_EJB3"
+[ "x$JBOSS_UDP_PORT_EJB3SFSB" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.ejb3sfsbpartition.mcast_port=$JBOSS_UDP_PORT_EJB3SFSB"
+[ "x$JBOSS_PROXY_LIST" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.mod_cluster.proxyList=$JBOSS_PROXY_LIST"
+
+JAVA_OPTS="$JAVA_OPTS -Djboss.jvmRoute=node-$IP_ADDRESS"
+
+[ "x$JBOSS_GOSSIP_HOST" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.gossip_host=$JBOSS_GOSSIP_HOST"
+[ "x$JBOSS_GOSSIP_PORT" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.gossip_port=$JBOSS_GOSSIP_PORT"
+[ "x$JBOSS_GOSSIP_REFRESH" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.gossip_refresh=$JBOSS_GOSSIP_REFRESH"
+
+[ "x$JBOSS_SERVER_PEER_ID" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS -Djboss.messaging.ServerPeerID=$JBOSS_SERVER_PEER_ID"
+
+[ "x$JBOSS_ADDITIONAL_PARAMS" != "x" ] && \
+JAVA_OPTS="$JAVA_OPTS $JBOSS_ADDITIONAL_PARAMS"
+
+# Set the awt.headless option
+JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
+export JAVA_OPTS
+
+CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
+
+# For SELinux we need to use 'runuser' not 'su'
+if [ -x /sbin/runuser ]
+then
+ SU=runuser
+else
+ SU=su
+fi
+
+if [ "$JBOSSUS" = "RUNASIS" ]; then
+ SUBIT=""
+else
+ SUBIT="$SU - $JBOSSUS -s /bin/sh -c "
+fi
+
+if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
+ export PATH=$PATH:$JAVAPTH
+fi
+
+mkdir -p $JBOSS_HOME/server/$JBOSSCONF/log/
+
+if [ "$JBOSSUS" != "RUNASIS" ]; then
+ chown $JBOSSUS:$JBOSSGR $JBOSS_HOME/server/$JBOSSCONF/log/
+fi
+
+if [ -a $JBOSS_HOME ] && [ ! -d "$JBOSS_HOME" ]; then
+ echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME >> $LOGFILE
+ if [ "$JBOSSUS" != "RUNASIS" ]; then
+ chown $JBOSSUS:$JBOSSGR $LOGFILE
+ fi
+ exit 1
+fi
+
+RETVAL=0
+
+function procrunning() {
+ procid=0
+ #JBOSSSCRIPT=$(echo $JBOSS_HOME/bin/run.sh|sed 's/\//\\\//g')
+ for procid in `pidof -x "/bin/sh"`; do
+ if [ ! -z $JBOSS_IP ]; then
+ ps -fp $procid | grep $JBOSSCONF | grep $JBOSS_IP > /dev/null && pid=$procid
+ else
+ ps -fp $procid | grep $JBOSSCONF > /dev/null && pid=$procid
+ fi
+ done
+}
+
+start() {
+ echo -n "Starting ${NAME}: "
+
+ # if lock file exists
+ if [ -f $JBOSSLOCK ]; then
+ procrunning
+ if [ ! $pid = '0' ]; then
+ failure $"${NAME} startup"
+ echo -n "Process already running"
+ return 2
+ fi
+ fi
+
+ # check if port 8080 is being used
+ if [ -z $JBOSS_IP ] && [ $JBOSSCONF != "ports-01" ] && [ $JBOSSCONF != "ports-02" ] && [ $JBOSSCONF != "ports-03" ] && [ $JBOSSCONF != "minimal" ]; then
+ portbusy=`netstat -apntl|grep ":8080"`
+ if test "x$portbusy" != x; then
+ failure $"${NAME} startup"
+ echo -n -e "\nPort 8080 is busy, is there a Tomcat running?"
+ echo -n -e "\n"
+ return 1
+ fi
+ fi
+
+ if [ "$JBOSSUS" != "RUNASIS" ]; then
+ if [ -z "`id $JBOSSUS 2>/dev/null |grep uid`" ]; then
+ failure $"${NAME} startup"
+ echo -n -e "\nUser $JBOSSUS does not exist. Create user first."
+ echo -n -e "\n"
+ return 2
+ fi
+ if [ -z "`grep "$JBOSSGR:" /etc/group`" ]; then
+ failure $"${NAME} startup"
+ echo -n -e "\nGroup $JBOSSGR does not exist. Create group first."
+ echo -n -e "\n"
+ return 3
+ fi
+ fi
+
+ touch $JBOSS_HOME/server/$JBOSSCONF/log/temp.file
+
+ # check if JBOSS_HOME directory exists, create it if it does not
+ if [ ! -d $JBOSS_HOME ]; then
+ #check permission
+ p=$JBOSS_HOME
+ while [ $p != "/" ]; do
+ p=`dirname $p`
+ # if it's a directory but not writable
+ if [ -d $p ] && [ ! -w $p ]; then
+ echo -n -e "\nDirectory $p is not writable, cannot create $JBOSS_HOME."
+ echo -n -e "\n"
+ return 4
+ fi
+ done
+ mkdir -p $JBOSS_HOME
+ fi
+
+ #clone the directory if it doesn't exist
+ if [ $JBOSS_HOME != "/var/lib/jbossas" ] && [ ! -d $JBOSS_HOME ]; then
+ for dirname in `ls /var/lib/jbossas`; do
+ if [ ! $dirname = "server" ]; then
+ cp -pL -R /var/lib/jbossas/$dirname $JBOSS_HOME
+ else
+ for i in all default minimal; do
+ mkdir -p $JBOSS_HOME/$dirname/$i
+ for j in `ls /var/lib/jbossas/$dirname/$i` ; do
+ if [ ! $j = "log" ]; then
+ cp -pL -R /var/lib/jbossas/$dirname/$i/$j $JBOSS_HOME/$dirname/$i/$j
+ fi
+ done
+ done
+ fi
+ done
+ fi
+
+ if [ ! -d $JBOSS_HOME/server/$JBOSSCONF/conf ]; then
+ for i in `ls /var/lib/jbossas/server/all` ; do
+ if [ ! $i == "log" ]; then
+ cp -pL -R /var/lib/jbossas/server/all/$i $JBOSS_HOME/server/$JBOSSCONF/
+ fi
+ done
+ fi
+
+ #make JBOSS_HOME owned by $JBOSSUS:$JBOSSGR
+ if [ "$JBOSSUS" != "RUNASIS" ]; then
+ chown -R $JBOSSUS:$JBOSSGR $JBOSS_HOME
+ fi
+
+ echo CMD_START = $CMD_START > $LOGFILE
+
+ if [ "$JBOSSUS" != "RUNASIS" ]; then
+ chown $JBOSSUS:$JBOSSGR $LOGFILE
+ fi
+
+ if [ $JBOSSCONF == "ports-01" ] || [ $JBOSSCONF == "ports-02" ] || [ $JBOSSCONF == "ports-03" ] ; then
+ # update config file for the configuration
+ cp $JBOSS_HOME/server/$JBOSSCONF/conf/jboss-service.xml $JBOSS_HOME/server/$JBOSSCONF/conf/jboss-service.xml.orig
+ sedcom=s\/ports\-01\/$JBOSSCONF\/g
+ sed -e 's/implementation to create to obtain the ServicesStore instance./implementation to create to obtain the ServicesStore instance. \-\-\>/g' -e $sedcom -e '195,195s/-->//' $JBOSS_HOME/server/$JBOSSCONF/conf/jboss-service.xml.orig > $JBOSS_HOME/server/$JBOSSCONF/conf/jboss-service.xml
+ fi
+
+ cd $JBOSS_HOME/bin
+
+ # determine userid to start jboss
+ if [ -z "$SUBIT" ]; then
+ eval $CMD_START >>${JBOSS_CONSOLE} 2>&1 &
+ else
+ $SUBIT "export JAVA_HOME=$JAVA_HOME; export JAVA_OPTS=\"$JAVA_OPTS\";$CMD_START >> $JBOSS_HOME/server/$JBOSSCONF/log/jboss-boot.log 2>&1 &"
+ fi
+
+ sleep=0
+ RETVAL=1
+ while [ $sleep -lt $JBOSS_START_TIMEOUT -a $RETVAL -eq 1 ]; do
+ #echo -n -e "\nwaiting for processes to start";
+ sleep 5
+ sleep=`expr $sleep + 5`
+ # if server.log has been updated
+ if [ $JBOSS_HOME/server/$JBOSSCONF/log/temp.file -ot $JBOSS_HOME/server/$JBOSSCONF/log/server.log ]; then
+ #grep -q MicroKernel $JBOSS_HOME/server/$JBOSSCONF/log/server.log > /dev/null 2>&1
+ grep -qe "^.*org.jboss.bootstrap.impl.base.server.AbstractServer.*Started in.*" $JBOSS_HOME/server/$JBOSSCONF/log/server.log > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ touch /var/lock/subsys/${NAME}
+ RETVAL=0
+ fi
+ fi
+ pid=0
+ procrunning
+ if [ $pid == '0' ]; then
+ failure $"${NAME} startup"
+ echo -n -e "\nProcess crashed on startup"
+ echo
+ RETVAL=2
+ fi
+ done
+ rm $JBOSS_HOME/server/$JBOSSCONF/log/temp.file
+
+ if [ -r /etc/rc.d/init.d/functions ]; then
+ if [ $RETVAL -eq 0 ]; then
+ success $"${NAME} startup"
+ else
+ # check if the process is still running
+ pid=0
+ procrunning
+ if [ ! $pid = '0' ]; then
+ echo -n -e "\n${NAME} startup has timed out, process still running. \n"
+ echo
+ else
+ failure $"${NAME} startup"
+ fi
+ fi
+ fi
+
+ echo
+ [ $RETVAL = 0 ] && touch $JBOSSLOCK
+ pid=0
+ procrunning
+ if [ ! $pid = '0' ]; then
+ echo $pid > $JBOSSPID
+ if [ "$JBOSSUS" != "RUNASIS" ]; then
+ chown $JBOSSUS:$JBOSSGR $JBOSSPID
+ fi
+ fi
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping ${NAME}: "
+ pid=0
+ procrunning
+ if [ $pid = '0' ]; then
+ failure $"${NAME} shutdown"
+ echo -n -e "\nNo JBoss AS is currently running\n"
+ if [ -f $JBOSSLOCK ]; then
+ rm -f $JBOSSLOCK
+ fi
+ if [ -f $JBOSSPID ]; then
+ rm -f $JBOSSPID
+ fi
+ return 1
+ fi
+
+ pid=0
+ RETVAL=1
+ procrunning
+
+ # If process is still running
+
+ # First, try to kill it nicely
+ if [ $RETVAL != 0 ] ; then
+ for id in `ps --ppid $pid | awk '{print $1}' | grep -v "^PID$"`; do
+ $SUBIT "kill -15 $id" 2>/dev/null
+ done
+
+ sleep=0
+ while [ $sleep -lt $JBOSS_STOP_TIMEOUT -a $RETVAL -eq 1 ]; do
+ sleep 5
+ sleep=`expr $sleep + 5`
+ pid=0
+ procrunning
+ if [ $pid == '0' ]; then
+ RETVAL=0
+ fi
+ done
+ fi
+
+ # Still not dead... notify user
+
+ count=0
+ pid=0
+ procrunning
+
+ if [ $pid != '0' ] ; then
+ jboss_java_pid=`ps --ppid $pid | grep java | awk '{print $1}'`
+ echo -e "\nTimeout: Shutdown command was sent, but process is still running with PID $jboss_java_pid"
+ failure $"${NAME} shutdown"
+ else
+ rm -f /var/lock/subsys/${NAME}
+ if [ -r /etc/rc.d/init.d/functions ]; then
+ success $"${NAME} shutdown"
+ fi
+ fi
+
+ echo
+ [ $RETVAL -eq 0 ] && rm -f $JBOSSLOCK $JBOSSPID
+ return $RETVAL
+}
+
+status() {
+ pid=0
+ procrunning
+ if [ $pid == 0 ]; then
+ if [ -f $JBOSSLOCK ]; then
+ echo "${NAME} is dead but subsys locked";
+ return 2
+ fi
+ if [ -f $JBOSSPID ]; then
+ echo "${NAME} is dead but pid file exists";
+ return 3
+ fi
+ echo "${NAME} is stopped";
+ return 0
+ else
+ echo "${NAME} (pid $pid) is running...";
+ return 0
+ fi
+}
+
+# Restart only if process is already running
+condrestart() {
+ pid=0
+ procrunning
+ if [ $pid != 0 ]; then
+ stop
+ sleep 3
+ start
+ fi
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+restart|reload)
+ stop
+ sleep 3
+ start
+ ;;
+condrestart)
+ condrestart
+ ;;
+status)
+ status
+ ;;
+help)
+ echo "usage: ${NAME} (start|stop|status|restart|help)"
+ ;;
+*)
+ echo "usage: ${NAME} (start|stop|status|restart|help)"
+ exit 1
+esac
+
+exit $RETVAL
Please sign in to comment.
Something went wrong with that request. Please try again.