Liferay init script

A Liferay init script This is for the pre systemd init systems in Red Hat/CentOS/Fedora.

Copied from this article with minor changes.

#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 2345 20 80
JAVA_HOME=/usr/lib/jvm/java
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/data/app/liferay/tomcat

case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)   
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac    
exit 0

On my test systems a liferay user and group own /data/app/liferay, which is also their $HOME. I am currently testing with OpenJDK 1.7.0_55, as this is the standard JDK in use at my company for most open source software. Note that I’m using the latest Liferay zip bundle that includes Tomcat 7.0.42, and that I’ve created a “tomcat” symlink to the versioned app server directory to avoid having to change things when the version changes (all I’ll need to do is re-create the symlink).

This entry was posted in Development, System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).