April 12, 2020
Estimated Post Reading Time ~

Updated init script for CQ5.5

Jorg Hoh over at cqdump.wordpress.com has a nice article on how to write an init script for cq5.4 – since CQ5.5 changed a bit on how it starts/stops cq, I figured I’ll post a new version of his script that’s cq5.5 compatible

#!/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


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.