summaryrefslogtreecommitdiff
blob: 9147dbf054c8e6e393f50f642fa2918535091b7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- mode: shell-script; mode: outline-minor; outline-regexp: "##+"; indent-tabs-mode: nil -*-

## GENERAL SETTINGS

# You can choose which configuration you want to run JBoss with.  The
# default configuration is, you guessed it, 'default'. The Gentoo
# JBoss installation ships with two other predefined configurations;
# 'all' and 'minimal'. The configurations are located in
# $JBOSS_HOME/server/

# JBOSS_CONF="all"
JBOSS_CONF="default"
# JBOSS_CONF="minimal"

# Console logging defaults to '/dev/null'. This env variable is
# included for debugging purposes.  You might have to run add
# $JBOSS_USER to the 'console' group to gain access to '/dev/console'.

JBOSS_CONSOLE="/dev/null" 
# JBOSS_CONSOLE="/dev/console"

# The user JBoss will run as.

JBOSS_USER="jboss"


## SPECIFIC SETTINGS

SERVER_SETTINGS=""

# The directory JBoss will use for temporary file storage

SERVER_SETTINGS="${SERVER_SETTINGS} -Djboss.server.temp.dir=/var/tmp/jboss"

# The directory which JBoss will use for persistent data file storage

SERVER_SETTINGS="${SERVER_SETTINGS} -Djboss.server.data.dir=/var/cache/jboss"

# The base URL for calculating server home URLs.  In a stock JBoss
# install, this would be <jboss_home>/server/ where sub-directories
# default, minimal and all exist.  Our defaults are /var/lib/jboss to
# be consistent with other servers such as PostgreSQL and Apache.

SERVER_HOME="/var/lib/jboss"
SERVER_SETTINGS="${SERVER_SETTINGS} -Djboss.server.base.url=file://${SERVER_HOME}"

# Whether or not the server should exit the JVM on shutdown (comment
# out to disable)

# SERVER_SETTINGS="${SERVER_SETTINGS} -Djboss.server.exitonshutdown"

# Whether or not the server should shutdown synchronously (true) or
# asynchronously (false).

SERVER_SETTINGS="${SERVER_SETTINGS} -Djboss.server.exitonshutdown=false"

# The address JBoss will bind services to.  (Note: JBoss 3.2.3 ignores
# the JVM environment parameter in favour of the command line switch.)

JBOSS_BIND_ADDRESS="0.0.0.0"


## STARTUP/SHUTDOWN CONFIGURATION

# Commands used in starting/stopping the server.  Normally you would
# not need to change the following settings.

# We need to have JBOSS_HOME and JAVA_HOME set in order to start
# jboss.

[ -z "$JBOSS_HOME" ] \
    && export JBOSS_HOME=`grep JBOSS_HOME /etc/profile.env | sed -e "s;.*=;;" -e "s;';;g"`
[ -z "$JAVA_HOME" ] \
    && export JAVA_HOME=`java-config --jdk-home`

# Commands for starting and stopping the server

CMD_START="JAVA_OPTS=\"${SERVER_SETTINGS}\" ${JBOSS_HOME}/bin/run.sh -b ${JBOSS_BIND_ADDRESS} -c ${JBOSS_CONF}" 

CMD_STOP="${JAVA_HOME}/bin/java -classpath ${JBOSS_HOME}/bin/shutdown.jar:${JBOSS_HOME}/lib/jboss-system.jar:`java-config --classpath=jboss` org.jboss.Shutdown -S"

SUBIT="su $JBOSS_USER -c "