Skip to content

Instantly share code, notes, and snippets.

@haiderfaraz
Created May 23, 2012 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haiderfaraz/2773431 to your computer and use it in GitHub Desktop.
Save haiderfaraz/2773431 to your computer and use it in GitHub Desktop.
Service Script for LifeRay on Ubuntu 12.04
#!/bin/bash
# LifeRay Startup Service script v1.0 by Faraz Haider 6 May 2012
# acts as startup service script for LifeRay Portal.
# USAGE: start|stop|status|logs
#
case "$1" in
start)
echo "Starting LifeRay Web Portal."
export JAVA_HOME=/opt/j2sdk/jdk1.7.0_03
export JRE_HOME=/opt/j2sdk/jdk1.7.0_03/jre
/opt/webportal/liferay-portal-6.1.0-ce-ga1/tomcat-7.0.23/bin/startup.sh
;;
stop)
echo "Stopping LifeRay Web Portal."
export JAVA_HOME=/opt/j2sdk/jdk1.7.0_03
export JRE_HOME=/opt/j2sdk/jdk1.7.0_03/jre
/opt/webportal/liferay-portal-6.1.0-ce-ga1/tomcat-7.0.23/bin/shutdown.sh
;;
logs)
echo "See the logs of the LifeRay Web Portal."
tail -f /opt/webportal/liferay-portal-6.1.0-ce-ga1/tomcat-7.0.23/logs/catalina.out
;;
status)
# Check to see if the process is running
ps aux|grep -i liferay
;;
*)
echo “LifeRay Web Portal Service”
echo $”Usage: $0 {start|stop|status|logs}”
exit 1
esac
exit 0
@lrkwz
Copy link

lrkwz commented Oct 28, 2014

Thank you!
According to https://wiki.debian.org/LSBInitScripts you shoud provide

### BEGIN INIT INFO
# Provides:          liferay
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start liferay daemon at boot time
# Description:       Enable liferay provided by daemon.
### END INIT INFO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment