#!/bin/sh
### BEGIN INIT INFO
# Provides: cq55
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start, stop adobe cq5.5
# Description: Start, stop adobe cq5.5
### END INIT INFO
CQ5_ROOT=CQROOT
CQ5_USER=CQUSER
########
SERVER=${CQ5_ROOT}/crx-quickstart
START=${SERVER}/bin/start
STOP=${SERVER}/bin/stop
STATUS="${SERVER}/bin/status"
case "$1" in
start)
su - ${CQ5_USER} ${START}
;;
stop)
su - ${CQ5_USER} ${STOP}
;;
status)
su - ${CQ5_USER} ${STATUS}
;;
*)
echo "Unknown argument $1"
;;
esac
Replace CQROOT with the folder where you installed CQ, CQUSER with the user that you want to run CQ as. I also added a header for init script management into the script file. This will allow you to use update=rc.d on ubuntu or chkconfig on centos:
ubuntu:
sudo update-rc.d -f cq55 remove
centos:
sudo chkconfig --del cq55
ubuntu:
sudo update-rc.d -f cq55 remove
centos:
sudo chkconfig --del cq55
No comments:
Post a Comment
If you have any doubts or questions, please let us know.