linux-service.template revision ada1678a4262b208a7b87391f520a7767d25287c
615f17d0171dd807c6803b25a255a8ea2051fbd4David Lawrence# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# The contents of this file are subject to the terms of either the GNU
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# General Public License Version 2 only ("GPL") or the Common Development
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# and Distribution License("CDDL") (collectively, the "License"). You
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# may not use this file except in compliance with the License. You can
615f17d0171dd807c6803b25a255a8ea2051fbd4David Lawrence# obtain a copy of the License at
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer# or packager/legal/LICENSE.txt. See the License for the specific
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer# language governing permissions and limitations under the License.
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer# When distributing the software, include this License Header Notice in each
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer# file and include the License file at packager/legal/LICENSE.txt.
95be83b467e2384d414693982318a5c06cccf1d7Andreas Gustafsson# GPL Classpath Exception:
f9354808d122036e66e9f007a4bb12d4aa936aaeAndreas Gustafsson# Oracle designates this particular file as subject to the "Classpath"
f9354808d122036e66e9f007a4bb12d4aa936aaeAndreas Gustafsson# exception as provided by Oracle in the GPL Version 2 section of the License
f9354808d122036e66e9f007a4bb12d4aa936aaeAndreas Gustafsson# file that accompanied this code.
b1d234eb75e2804e09d89178a76df39c321db51bBrian Wellington# Modifications:
b1d234eb75e2804e09d89178a76df39c321db51bBrian Wellington# If applicable, add the following below the License Header, with the fields
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# enclosed by brackets [] replaced by your own identifying information:
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# "Portions Copyright [year] [name of copyright owner]"
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# Contributor(s):
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# If you wish your version of this file to be governed by only the CDDL or
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# only the GPL Version 2, indicate your decision by adding "[Contributor]
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# elects to include this software in this distribution under the [CDDL or GPL
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# Version 2] license." If you don't indicate a single choice of license, a
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# recipient has the option to distribute your version of this file under
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# either the CDDL, the GPL Version 2 or to extend the choice of license to
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# its licensees as provided above. However, if you add GPL Version 2 code
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# and therefore, elected the GPL Version 2 license, then the option applies
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# only if the new code is made subject to such option by the copyright
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# Linux Platform Services for GlassFish
353dcaf1cc77d122d9b4b750bbbfc4c96b4b292bAndreas Gustafsson# See this blog for more details:
615f17d0171dd807c6803b25a255a8ea2051fbd4David Lawrence# http://blogs.sun.com/foo/entry/run_glassfish_v3_as_a
615f17d0171dd807c6803b25a255a8ea2051fbd4David Lawrence# Remove the GF_USER setting to have the System account run GlassFish
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# Created on : %%%DATE_CREATED%%%
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# Server Type: %%%TYPE%%%
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff %%%SERVICEUSER_START%%%$ASADMIN %%%START_COMMAND%%% %%%CREDENTIALS%%% %%%LOCATION_ARGS_START%%% %%%ENTITY_NAME%%% > /dev/null 2>&1 &%%%SERVICEUSER_STOP%%%
353dcaf1cc77d122d9b4b750bbbfc4c96b4b292bAndreas Gustafsson %%%SERVICEUSER_START%%%$ASADMIN %%%STOP_COMMAND%%% %%%LOCATION_ARGS_STOP%%% %%%ENTITY_NAME%%% > /dev/null 2>&1 &%%%SERVICEUSER_STOP%%%
615f17d0171dd807c6803b25a255a8ea2051fbd4David Lawrence %%%SERVICEUSER_START%%%$ASADMIN %%%RESTART_COMMAND%%% %%%LOCATION_ARGS_RESTART%%% %%%ENTITY_NAME%%% > /dev/null 2>&1 &%%%SERVICEUSER_STOP%%%
615f17d0171dd807c6803b25a255a8ea2051fbd4David Lawrence echo "usage: $0 (start|stop|restart|help)"
58007c5fde59b756174280d26916eb27f593e6ccBob Halley# Example commands that demonstrate how to run GlassFish on the "special" ports < 1024
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
5a0ffa97751ef1ff29d1bf9d7f332eeb9f8edc21Michael Graff# iptables -t nat -A PREROUTING -p udp -m udp --dport 80 -j REDIRECT --to-ports 8080