20140625 liferay init script - plembo/onemoretech GitHub Wiki

title: Liferay init script link: https://onemoretech.wordpress.com/2014/06/25/liferay-init-script/ author: phil2nc description: post_id: 7961 created: 2014/06/25 12:50:33 created_gmt: 2014/06/25 16:50:33 comment_status: closed post_name: liferay-init-script status: publish post_type: post

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).

Copyright 2004-2019 Phil Lembo