Skip to content

Instantly share code, notes, and snippets.

@firdausramlan
Created February 11, 2012 04:25
Show Gist options
  • Save firdausramlan/1796150 to your computer and use it in GitHub Desktop.
Save firdausramlan/1796150 to your computer and use it in GitHub Desktop.
ColdFusion Init Script
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: jrun
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop ColdFusion as service
### END INIT INFO
ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"
set -e
. /lib/lsb/init-functions
test -f /etc/default/rcS && . /etc/default/rcS
CFJRUN="$ENV /opt/jrun4/bin/jrun"
INSTANCE_NAME="dev"
case $1 in
start)
echo -n "Starting CF server $INSTANCE_NAME"
$CFJRUN start $INSTANCE_NAME &
echo
;;
stop)
echo -n "Stopping CF server $INSTANCE_NAME"
$CFJRUN stop $INSTANCE_NAME
echo
;;
restart | force-reload)
echo -n "Restarting CF server $INSTANCE_NAME"
$CFJRUN restart $INSTANCE_NAME &
echo
;;
status)
echo -n "Getting CF server statuses"
$CFJRUN status
echo
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment