#!/bin/bash # # daycq init script for Adobe Day CQ5 # # chkconfig: 35 90 12 # description: Adobe Day CQ5 # author: Rackspace Critical Application Services # # This script is designed for CQ5.5 and has not been tested with CQ5.4 and below. # # configuration file: /opt/cq5/crx-quickstart/bin/start # # Source function library. if [ -f /etc/rc.d/functions ]; then . /etc/init.d/functions fi CQ5_ROOT=/opt/cq5 CQ5_USER=dayuser SERVER=${CQ5_ROOT}/crx-quickstart START=${SERVER}/bin/start STOP=${SERVER}/bin/stop STATUS=${SERVER}/bin/status LOGFILE=${SERVER}/logs/startup.log LOCKFILE=${LOCKFILE-/var/lock/subsys/cq5} # Start the service daycq start() { echo -n $"Starting Adobe Day CQ server. This may take some time... " # Check to see if CQ5 is already running or shutdown uncleanly if [ -f ${LOCKFILE} ]; then echo "CQ5 lock file exists at ${LOCKFILE}. CQ5 is already running or was shutdown uncleanly." exit 1 fi su - ${CQ5_USER} ${START} &> ${LOGFILE} RETVAL=$? echo ### Create the lock file if startup was successful ### [ $RETVAL = 0 ] && touch ${LOCKFILE} return $RETVAL } # Stop the service daycq stop() { echo "Stopping Adobe Day CQ server: " su - ${CQ5_USER} ${STOP} RETVAL=$? echo ### Now, delete the lock file ### [ $RETVAL = 0 ] && rm -f ${LOCKFILE} return $RETVAL } # Check the status of daycq status() { su ${CQ5_USER} ${STATUS} } ### main logic ### case "$1" in start) start ;; stop) stop ;; status) status ;; restart|reload|condrestart) stop sleep 5 start ;; *) echo $"Usage: $0 {start|stop|restart|reload|status}" exit 1 esac exit 0